-
-
Notifications
You must be signed in to change notification settings - Fork 167
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIG] maintenance_stock: Migration to 14.0
- Loading branch information
1 parent
b6a5612
commit 22bdf26
Showing
10 changed files
with
195 additions
and
213 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,147 +1,150 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<odoo> | ||
<data noupdate="1"> | ||
<odoo noupdate="1"> | ||
<record id="location_inventory" model="stock.location"> | ||
<field name="name">Inventory adjustment</field> | ||
<field name="usage">inventory</field> | ||
|
||
<record id="stock_warehouse_maintenance" model="stock.warehouse"> | ||
<field name="name">Maintenance Warehouse</field> | ||
<field name="partner_id" ref="stock.res_partner_address_41" /> | ||
<field name="code">Main</field> | ||
</record> | ||
</record> | ||
<record id="stock_warehouse_maintenance" model="stock.warehouse"> | ||
<field name="name">Maintenance Warehouse</field> | ||
<field name="partner_id" ref="stock.res_partner_address_41" /> | ||
<field name="code">Main</field> | ||
<field name="reception_steps">one_step</field> | ||
<field name="delivery_steps">ship_only</field> | ||
</record> | ||
|
||
<function model="ir.model.data" name="_update_xmlids"> | ||
<value | ||
model="base" | ||
eval="[{ | ||
'xml_id': 'maintenance_stock.main_picking_type_cons', | ||
'record': obj().env.ref('maintenance_stock.stock_warehouse_maintenance').cons_type_id, | ||
'noupdate': True, | ||
}, { | ||
'xml_id': 'maintenance_stock.main_location_stock', | ||
'record': obj().env.ref('maintenance_stock.stock_warehouse_maintenance').lot_stock_id, | ||
'noupdate': True, | ||
}, { | ||
'xml_id': 'maintenance_stock.main_location_cons', | ||
'record': obj().env.ref('maintenance_stock.stock_warehouse_maintenance').wh_cons_loc_id, | ||
'noupdate': True, | ||
}]" | ||
/> | ||
</function> | ||
<function model="ir.model.data" name="_update_xmlids"> | ||
<value | ||
model="base" | ||
eval="[{ | ||
'xml_id': 'maintenance_stock.main_picking_type_cons', | ||
'record': obj().env.ref('maintenance_stock.stock_warehouse_maintenance').cons_type_id, | ||
'noupdate': True, | ||
}, { | ||
'xml_id': 'maintenance_stock.main_location_stock', | ||
'record': obj().env.ref('maintenance_stock.stock_warehouse_maintenance').lot_stock_id, | ||
'noupdate': True, | ||
}, { | ||
'xml_id': 'maintenance_stock.main_location_cons', | ||
'record': obj().env.ref('maintenance_stock.stock_warehouse_maintenance').wh_cons_loc_id, | ||
'noupdate': True, | ||
}]" | ||
/> | ||
</function> | ||
|
||
<record id="product_toner" model="product.product"> | ||
<field name="default_code">TON_1234</field> | ||
<field name="name">Toner</field> | ||
<field name="type">product</field> | ||
<field name="categ_id" ref="product.product_category_5" /> | ||
<field name="lst_price">100.0</field> | ||
<field name="standard_price">70.0</field> | ||
<field name="uom_id" ref="uom.product_uom_unit" /> | ||
<field name="uom_po_id" ref="uom.product_uom_unit" /> | ||
<field | ||
name="image" | ||
type="base64" | ||
file="maintenance_stock/static/img/toner.png" | ||
/> | ||
</record> | ||
<record id="product_toner" model="product.product"> | ||
<field name="default_code">TON_1234</field> | ||
<field name="name">Toner</field> | ||
<field name="type">product</field> | ||
<field name="categ_id" ref="product.product_category_5" /> | ||
<field name="lst_price">100.0</field> | ||
<field name="standard_price">70.0</field> | ||
<field name="uom_id" ref="uom.product_uom_unit" /> | ||
<field name="uom_po_id" ref="uom.product_uom_unit" /> | ||
<field | ||
name="image_1920" | ||
type="base64" | ||
file="maintenance_stock/static/img/toner.png" | ||
/> | ||
|
||
<record id="stock_inventory_toner" model="stock.inventory"> | ||
<field name="name">Inventory for Toner</field> | ||
<field | ||
name="product_ids" | ||
eval="[(4, ref('maintenance_stock.product_toner'))]" | ||
/> | ||
</record> | ||
</record> | ||
|
||
<record id="stock_inventory_toner_line" model="stock.inventory.line"> | ||
<field name="product_id" ref="maintenance_stock.product_toner" /> | ||
<field name="product_uom_id" ref="uom.product_uom_unit" /> | ||
<field name="inventory_id" ref="maintenance_stock.stock_inventory_toner" /> | ||
<field name="product_qty">50.0</field> | ||
<field name="location_id" ref="maintenance_stock.main_location_stock" /> | ||
</record> | ||
<record id="stock_inventory_toner" model="stock.inventory"> | ||
<field name="name">Inventory for Toner</field> | ||
<field | ||
name="product_ids" | ||
eval="[(6,0,[ref('maintenance_stock.product_toner'),])]" | ||
/> | ||
|
||
<function model="stock.inventory" name="_action_start"> | ||
<function | ||
eval="[[('state','=','draft'),('id', '=', ref('maintenance_stock.stock_inventory_toner'))]]" | ||
model="stock.inventory" | ||
name="search" | ||
/> | ||
</function> | ||
</record> | ||
|
||
<function model="stock.inventory" name="action_validate"> | ||
<function | ||
eval="[[('state','=','confirm'),('id', '=', ref('maintenance_stock.stock_inventory_toner'))]]" | ||
model="stock.inventory" | ||
name="search" | ||
/> | ||
</function> | ||
<record id="stock_inventory_toner_line" model="stock.inventory.line"> | ||
<field name="product_id" ref="maintenance_stock.product_toner" /> | ||
<field name="product_uom_id" ref="uom.product_uom_unit" /> | ||
<field name="inventory_id" ref="maintenance_stock.stock_inventory_toner" /> | ||
<field name="product_qty">50.0</field> | ||
<field name="location_id" ref="maintenance_stock.main_location_stock" /> | ||
</record> | ||
<function name="action_start" model="stock.inventory"> | ||
<function | ||
eval="[[('id', '=', ref('maintenance_stock.stock_inventory_toner'))]]" | ||
model="stock.inventory" | ||
name="search" | ||
/> | ||
</function> | ||
<function model="stock.inventory" name="action_validate"> | ||
<function | ||
eval="[[('state','in', ['draft', 'confirm']),('id', '=', ref('maintenance_stock.stock_inventory_toner'))]]" | ||
model="stock.inventory" | ||
name="search" | ||
/> | ||
</function> | ||
|
||
<record id="maintenance.equipment_printer1" model="maintenance.equipment"> | ||
<field name="allow_consumptions" eval="True" /> | ||
<field | ||
name="default_consumption_warehouse_id" | ||
ref="maintenance_stock.stock_warehouse_maintenance" | ||
/> | ||
</record> | ||
<record id="maintenance.equipment_printer1" model="maintenance.equipment"> | ||
<field name="allow_consumptions" eval="True" /> | ||
<field | ||
name="default_consumption_warehouse_id" | ||
ref="maintenance_stock.stock_warehouse_maintenance" | ||
/> | ||
|
||
<record id="m_request_1" model="maintenance.request"> | ||
<field name="name">Change toner</field> | ||
<field name="user_id" ref="base.user_demo" /> | ||
<field name="owner_user_id" ref="base.user_admin" /> | ||
<field name="equipment_id" ref="maintenance.equipment_printer1" /> | ||
<field name="color">7</field> | ||
<field name="stage_id" ref="maintenance.stage_1" /> | ||
<field | ||
name="maintenance_team_id" | ||
ref="maintenance.equipment_team_maintenance" | ||
/> | ||
</record> | ||
</record> | ||
|
||
<record id="consuption_picking_m_request_1" model="stock.picking"> | ||
<field | ||
name="picking_type_id" | ||
ref="maintenance_stock.main_picking_type_cons" | ||
/> | ||
<field name="date" eval="DateTime.today() - timedelta(days=15)" /> | ||
<field name="location_id" ref="maintenance_stock.main_location_stock" /> | ||
<field name="location_dest_id" ref="maintenance_stock.main_location_cons" /> | ||
<field name="maintenance_request_id" ref="maintenance_stock.m_request_1" /> | ||
<field | ||
name="move_lines" | ||
model="stock.move" | ||
eval="[(0, 0, { | ||
'name': obj().env.ref('maintenance_stock.product_toner').name, | ||
'product_id': ref('maintenance_stock.product_toner'), | ||
'product_uom': ref('uom.product_uom_unit'), | ||
'product_uom_qty': 1.0, | ||
'picking_type_id': ref('maintenance_stock.main_picking_type_cons'), | ||
'location_id': ref('maintenance_stock.main_location_stock'), | ||
'location_dest_id': ref('maintenance_stock.main_location_cons'), | ||
'move_line_ids': [(0, 0, { | ||
'product_id': ref('maintenance_stock.product_toner'), | ||
'qty_done': 1, | ||
'product_uom_id': ref('uom.product_uom_unit'), | ||
'location_id': ref('maintenance_stock.main_location_stock'), | ||
'location_dest_id': ref('maintenance_stock.main_location_cons'), | ||
})], | ||
})]" | ||
/> | ||
</record> | ||
<record id="m_request_1" model="maintenance.request"> | ||
<field name="name">Change toner</field> | ||
<field name="user_id" ref="base.user_demo" /> | ||
<field name="owner_user_id" ref="base.user_admin" /> | ||
<field name="equipment_id" ref="maintenance.equipment_printer1" /> | ||
<field name="color">7</field> | ||
<field name="stage_id" ref="maintenance.stage_1" /> | ||
|
||
<function model="stock.picking" name="action_confirm"> | ||
<value | ||
model="stock.picking" | ||
eval="[ | ||
obj().env.ref('maintenance_stock.consuption_picking_m_request_1').id]" | ||
/> | ||
</function> | ||
</record> | ||
<record model="stock.quant" id="stock_quant_toner"> | ||
<field name="product_id" ref="maintenance_stock.product_toner" /> | ||
<field name="location_id" ref="maintenance_stock.main_location_stock" /> | ||
<field name="quantity">1.0</field> | ||
</record> | ||
<record id="consuption_picking_m_request_1" model="stock.picking"> | ||
<field name="picking_type_id" ref="maintenance_stock.main_picking_type_cons" /> | ||
<field name="date" eval="DateTime.today() - timedelta(days=15)" /> | ||
<field name="location_id" ref="maintenance_stock.main_location_stock" /> | ||
<field name="location_dest_id" ref="maintenance_stock.main_location_cons" /> | ||
<field name="maintenance_request_id" ref="maintenance_stock.m_request_1" /> | ||
|
||
<function model="stock.picking" name="action_done"> | ||
<value | ||
model="stock.picking" | ||
eval="[ | ||
obj().env.ref('maintenance_stock.consuption_picking_m_request_1').id]" | ||
/> | ||
</function> | ||
<field | ||
name="move_lines" | ||
model="stock.move" | ||
eval="[(0, 0, { | ||
'name': obj().env.ref('maintenance_stock.product_toner').name, | ||
'product_id': ref('maintenance_stock.product_toner'), | ||
'product_uom': ref('uom.product_uom_unit'), | ||
'product_uom_qty': 1.0, | ||
'picking_type_id': ref('maintenance_stock.main_picking_type_cons'), | ||
'location_id': ref('maintenance_stock.main_location_stock'), | ||
'location_dest_id': ref('maintenance_stock.main_location_cons'), | ||
</data> | ||
})]" | ||
/> | ||
</record> | ||
|
||
<function model="stock.picking" name="action_confirm"> | ||
<value | ||
model="stock.picking" | ||
eval="[ | ||
obj().env.ref('maintenance_stock.consuption_picking_m_request_1').id]" | ||
/> | ||
</function> | ||
<function model="stock.picking" name="action_assign"> | ||
<value | ||
model="stock.picking" | ||
eval="[ | ||
obj().env.ref('maintenance_stock.consuption_picking_m_request_1').id]" | ||
/> | ||
</function> | ||
<function model="stock.picking" name="button_validate"> | ||
<value | ||
model="stock.picking" | ||
eval="[ | ||
obj().env.ref('maintenance_stock.consuption_picking_m_request_1').id]" | ||
/> | ||
</function> | ||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.