-
-
Notifications
You must be signed in to change notification settings - Fork 168
/
Copy pathdemo_maintenance_stock.xml
150 lines (136 loc) · 5.88 KB
/
demo_maintenance_stock.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<record id="location_inventory" model="stock.location">
<field name="name">Inventory adjustment</field>
<field name="usage">inventory</field>
</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>
<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>
<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'),])]"
/>
</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>
<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="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" />
</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" />
<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'),
})]"
/>
</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>