|
1 | 1 | <?xml version="1.0" encoding="utf-8" ?>
|
2 |
| -<odoo> |
3 |
| - <data noupdate="1"> |
| 2 | +<odoo noupdate="1"> |
| 3 | + <record id="location_inventory" model="stock.location"> |
| 4 | + <field name="name">Inventory adjustment</field> |
| 5 | + <field name="usage">inventory</field> |
4 | 6 |
|
5 |
| - <record id="stock_warehouse_maintenance" model="stock.warehouse"> |
6 |
| - <field name="name">Maintenance Warehouse</field> |
7 |
| - <field name="partner_id" ref="stock.res_partner_address_41" /> |
8 |
| - <field name="code">Main</field> |
9 |
| - </record> |
| 7 | + </record> |
| 8 | + <record id="stock_warehouse_maintenance" model="stock.warehouse"> |
| 9 | + <field name="name">Maintenance Warehouse</field> |
| 10 | + <field name="partner_id" ref="stock.res_partner_address_41" /> |
| 11 | + <field name="code">Main</field> |
| 12 | + <field name="reception_steps">one_step</field> |
| 13 | + <field name="delivery_steps">ship_only</field> |
| 14 | + </record> |
10 | 15 |
|
11 |
| - <function model="ir.model.data" name="_update_xmlids"> |
12 |
| - <value |
13 |
| - model="base" |
14 |
| - eval="[{ |
15 |
| - 'xml_id': 'maintenance_stock.main_picking_type_cons', |
16 |
| - 'record': obj().env.ref('maintenance_stock.stock_warehouse_maintenance').cons_type_id, |
17 |
| - 'noupdate': True, |
18 |
| - }, { |
19 |
| - 'xml_id': 'maintenance_stock.main_location_stock', |
20 |
| - 'record': obj().env.ref('maintenance_stock.stock_warehouse_maintenance').lot_stock_id, |
21 |
| - 'noupdate': True, |
22 |
| - }, { |
23 |
| - 'xml_id': 'maintenance_stock.main_location_cons', |
24 |
| - 'record': obj().env.ref('maintenance_stock.stock_warehouse_maintenance').wh_cons_loc_id, |
25 |
| - 'noupdate': True, |
26 |
| - }]" |
27 |
| - /> |
28 |
| - </function> |
| 16 | + <function model="ir.model.data" name="_update_xmlids"> |
| 17 | + <value |
| 18 | + model="base" |
| 19 | + eval="[{ |
| 20 | + 'xml_id': 'maintenance_stock.main_picking_type_cons', |
| 21 | + 'record': obj().env.ref('maintenance_stock.stock_warehouse_maintenance').cons_type_id, |
| 22 | + 'noupdate': True, |
| 23 | + }, { |
| 24 | + 'xml_id': 'maintenance_stock.main_location_stock', |
| 25 | + 'record': obj().env.ref('maintenance_stock.stock_warehouse_maintenance').lot_stock_id, |
| 26 | + 'noupdate': True, |
| 27 | + }, { |
| 28 | + 'xml_id': 'maintenance_stock.main_location_cons', |
| 29 | + 'record': obj().env.ref('maintenance_stock.stock_warehouse_maintenance').wh_cons_loc_id, |
| 30 | + 'noupdate': True, |
| 31 | + }]" |
| 32 | + /> |
| 33 | + </function> |
29 | 34 |
|
30 |
| - <record id="product_toner" model="product.product"> |
31 |
| - <field name="default_code">TON_1234</field> |
32 |
| - <field name="name">Toner</field> |
33 |
| - <field name="type">product</field> |
34 |
| - <field name="categ_id" ref="product.product_category_5" /> |
35 |
| - <field name="lst_price">100.0</field> |
36 |
| - <field name="standard_price">70.0</field> |
37 |
| - <field name="uom_id" ref="uom.product_uom_unit" /> |
38 |
| - <field name="uom_po_id" ref="uom.product_uom_unit" /> |
39 |
| - <field |
40 |
| - name="image" |
41 |
| - type="base64" |
42 |
| - file="maintenance_stock/static/img/toner.png" |
43 |
| - /> |
44 |
| - </record> |
| 35 | + <record id="product_toner" model="product.product"> |
| 36 | + <field name="default_code">TON_1234</field> |
| 37 | + <field name="name">Toner</field> |
| 38 | + <field name="type">product</field> |
| 39 | + <field name="categ_id" ref="product.product_category_5" /> |
| 40 | + <field name="lst_price">100.0</field> |
| 41 | + <field name="standard_price">70.0</field> |
| 42 | + <field name="uom_id" ref="uom.product_uom_unit" /> |
| 43 | + <field name="uom_po_id" ref="uom.product_uom_unit" /> |
| 44 | + <field |
| 45 | + name="image_1920" |
| 46 | + type="base64" |
| 47 | + file="maintenance_stock/static/img/toner.png" |
| 48 | + /> |
45 | 49 |
|
46 |
| - <record id="stock_inventory_toner" model="stock.inventory"> |
47 |
| - <field name="name">Inventory for Toner</field> |
48 |
| - <field |
49 |
| - name="product_ids" |
50 |
| - eval="[(4, ref('maintenance_stock.product_toner'))]" |
51 |
| - /> |
52 |
| - </record> |
| 50 | + </record> |
53 | 51 |
|
54 |
| - <record id="stock_inventory_toner_line" model="stock.inventory.line"> |
55 |
| - <field name="product_id" ref="maintenance_stock.product_toner" /> |
56 |
| - <field name="product_uom_id" ref="uom.product_uom_unit" /> |
57 |
| - <field name="inventory_id" ref="maintenance_stock.stock_inventory_toner" /> |
58 |
| - <field name="product_qty">50.0</field> |
59 |
| - <field name="location_id" ref="maintenance_stock.main_location_stock" /> |
60 |
| - </record> |
| 52 | + <record id="stock_inventory_toner" model="stock.inventory"> |
| 53 | + <field name="name">Inventory for Toner</field> |
| 54 | + <field |
| 55 | + name="product_ids" |
| 56 | + eval="[(6,0,[ref('maintenance_stock.product_toner'),])]" |
| 57 | + /> |
61 | 58 |
|
62 |
| - <function model="stock.inventory" name="_action_start"> |
63 |
| - <function |
64 |
| - eval="[[('state','=','draft'),('id', '=', ref('maintenance_stock.stock_inventory_toner'))]]" |
65 |
| - model="stock.inventory" |
66 |
| - name="search" |
67 |
| - /> |
68 |
| - </function> |
| 59 | + </record> |
69 | 60 |
|
70 |
| - <function model="stock.inventory" name="action_validate"> |
71 |
| - <function |
72 |
| - eval="[[('state','=','confirm'),('id', '=', ref('maintenance_stock.stock_inventory_toner'))]]" |
73 |
| - model="stock.inventory" |
74 |
| - name="search" |
75 |
| - /> |
76 |
| - </function> |
| 61 | + <record id="stock_inventory_toner_line" model="stock.inventory.line"> |
| 62 | + <field name="product_id" ref="maintenance_stock.product_toner" /> |
| 63 | + <field name="product_uom_id" ref="uom.product_uom_unit" /> |
| 64 | + <field name="inventory_id" ref="maintenance_stock.stock_inventory_toner" /> |
| 65 | + <field name="product_qty">50.0</field> |
| 66 | + <field name="location_id" ref="maintenance_stock.main_location_stock" /> |
| 67 | + </record> |
| 68 | + <function name="action_start" model="stock.inventory"> |
| 69 | + <function |
| 70 | + eval="[[('id', '=', ref('maintenance_stock.stock_inventory_toner'))]]" |
| 71 | + model="stock.inventory" |
| 72 | + name="search" |
| 73 | + /> |
| 74 | + </function> |
| 75 | + <function model="stock.inventory" name="action_validate"> |
| 76 | + <function |
| 77 | + eval="[[('state','in', ['draft', 'confirm']),('id', '=', ref('maintenance_stock.stock_inventory_toner'))]]" |
| 78 | + model="stock.inventory" |
| 79 | + name="search" |
| 80 | + /> |
| 81 | + </function> |
77 | 82 |
|
78 |
| - <record id="maintenance.equipment_printer1" model="maintenance.equipment"> |
79 |
| - <field name="allow_consumptions" eval="True" /> |
80 |
| - <field |
81 |
| - name="default_consumption_warehouse_id" |
82 |
| - ref="maintenance_stock.stock_warehouse_maintenance" |
83 |
| - /> |
84 |
| - </record> |
| 83 | + <record id="maintenance.equipment_printer1" model="maintenance.equipment"> |
| 84 | + <field name="allow_consumptions" eval="True" /> |
| 85 | + <field |
| 86 | + name="default_consumption_warehouse_id" |
| 87 | + ref="maintenance_stock.stock_warehouse_maintenance" |
| 88 | + /> |
85 | 89 |
|
86 |
| - <record id="m_request_1" model="maintenance.request"> |
87 |
| - <field name="name">Change toner</field> |
88 |
| - <field name="user_id" ref="base.user_demo" /> |
89 |
| - <field name="owner_user_id" ref="base.user_admin" /> |
90 |
| - <field name="equipment_id" ref="maintenance.equipment_printer1" /> |
91 |
| - <field name="color">7</field> |
92 |
| - <field name="stage_id" ref="maintenance.stage_1" /> |
93 |
| - <field |
94 |
| - name="maintenance_team_id" |
95 |
| - ref="maintenance.equipment_team_maintenance" |
96 |
| - /> |
97 |
| - </record> |
| 90 | + </record> |
98 | 91 |
|
99 |
| - <record id="consuption_picking_m_request_1" model="stock.picking"> |
100 |
| - <field |
101 |
| - name="picking_type_id" |
102 |
| - ref="maintenance_stock.main_picking_type_cons" |
103 |
| - /> |
104 |
| - <field name="date" eval="DateTime.today() - timedelta(days=15)" /> |
105 |
| - <field name="location_id" ref="maintenance_stock.main_location_stock" /> |
106 |
| - <field name="location_dest_id" ref="maintenance_stock.main_location_cons" /> |
107 |
| - <field name="maintenance_request_id" ref="maintenance_stock.m_request_1" /> |
108 |
| - <field |
109 |
| - name="move_lines" |
110 |
| - model="stock.move" |
111 |
| - eval="[(0, 0, { |
112 |
| - 'name': obj().env.ref('maintenance_stock.product_toner').name, |
113 |
| - 'product_id': ref('maintenance_stock.product_toner'), |
114 |
| - 'product_uom': ref('uom.product_uom_unit'), |
115 |
| - 'product_uom_qty': 1.0, |
116 |
| - 'picking_type_id': ref('maintenance_stock.main_picking_type_cons'), |
117 |
| - 'location_id': ref('maintenance_stock.main_location_stock'), |
118 |
| - 'location_dest_id': ref('maintenance_stock.main_location_cons'), |
119 |
| - 'move_line_ids': [(0, 0, { |
120 |
| - 'product_id': ref('maintenance_stock.product_toner'), |
121 |
| - 'qty_done': 1, |
122 |
| - 'product_uom_id': ref('uom.product_uom_unit'), |
123 |
| - 'location_id': ref('maintenance_stock.main_location_stock'), |
124 |
| - 'location_dest_id': ref('maintenance_stock.main_location_cons'), |
125 |
| - })], |
126 |
| - })]" |
127 |
| - /> |
128 |
| - </record> |
| 92 | + <record id="m_request_1" model="maintenance.request"> |
| 93 | + <field name="name">Change toner</field> |
| 94 | + <field name="user_id" ref="base.user_demo" /> |
| 95 | + <field name="owner_user_id" ref="base.user_admin" /> |
| 96 | + <field name="equipment_id" ref="maintenance.equipment_printer1" /> |
| 97 | + <field name="color">7</field> |
| 98 | + <field name="stage_id" ref="maintenance.stage_1" /> |
129 | 99 |
|
130 |
| - <function model="stock.picking" name="action_confirm"> |
131 |
| - <value |
132 |
| - model="stock.picking" |
133 |
| - eval="[ |
134 |
| - obj().env.ref('maintenance_stock.consuption_picking_m_request_1').id]" |
135 |
| - /> |
136 |
| - </function> |
| 100 | + </record> |
| 101 | + <record model="stock.quant" id="stock_quant_toner"> |
| 102 | + <field name="product_id" ref="maintenance_stock.product_toner" /> |
| 103 | + <field name="location_id" ref="maintenance_stock.main_location_stock" /> |
| 104 | + <field name="quantity">1.0</field> |
| 105 | + </record> |
| 106 | + <record id="consuption_picking_m_request_1" model="stock.picking"> |
| 107 | + <field name="picking_type_id" ref="maintenance_stock.main_picking_type_cons" /> |
| 108 | + <field name="date" eval="DateTime.today() - timedelta(days=15)" /> |
| 109 | + <field name="location_id" ref="maintenance_stock.main_location_stock" /> |
| 110 | + <field name="location_dest_id" ref="maintenance_stock.main_location_cons" /> |
| 111 | + <field name="maintenance_request_id" ref="maintenance_stock.m_request_1" /> |
137 | 112 |
|
138 |
| - <function model="stock.picking" name="action_done"> |
139 |
| - <value |
140 |
| - model="stock.picking" |
141 |
| - eval="[ |
142 |
| - obj().env.ref('maintenance_stock.consuption_picking_m_request_1').id]" |
143 |
| - /> |
144 |
| - </function> |
| 113 | + <field |
| 114 | + name="move_lines" |
| 115 | + model="stock.move" |
| 116 | + eval="[(0, 0, { |
| 117 | + 'name': obj().env.ref('maintenance_stock.product_toner').name, |
| 118 | + 'product_id': ref('maintenance_stock.product_toner'), |
| 119 | + 'product_uom': ref('uom.product_uom_unit'), |
| 120 | + 'product_uom_qty': 1.0, |
| 121 | + 'picking_type_id': ref('maintenance_stock.main_picking_type_cons'), |
| 122 | + 'location_id': ref('maintenance_stock.main_location_stock'), |
| 123 | + 'location_dest_id': ref('maintenance_stock.main_location_cons'), |
145 | 124 |
|
146 |
| - </data> |
| 125 | + })]" |
| 126 | + /> |
| 127 | + </record> |
| 128 | + |
| 129 | + <function model="stock.picking" name="action_confirm"> |
| 130 | + <value |
| 131 | + model="stock.picking" |
| 132 | + eval="[ |
| 133 | + obj().env.ref('maintenance_stock.consuption_picking_m_request_1').id]" |
| 134 | + /> |
| 135 | + </function> |
| 136 | + <function model="stock.picking" name="action_assign"> |
| 137 | + <value |
| 138 | + model="stock.picking" |
| 139 | + eval="[ |
| 140 | + obj().env.ref('maintenance_stock.consuption_picking_m_request_1').id]" |
| 141 | + /> |
| 142 | + </function> |
| 143 | + <function model="stock.picking" name="button_validate"> |
| 144 | + <value |
| 145 | + model="stock.picking" |
| 146 | + eval="[ |
| 147 | + obj().env.ref('maintenance_stock.consuption_picking_m_request_1').id]" |
| 148 | + /> |
| 149 | + </function> |
147 | 150 | </odoo>
|
0 commit comments