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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
|
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="stock_inventory_line_tree" model="ir.ui.view">
<field name="name">stock.inventory.line.tree</field>
<field name="model">stock.inventory.line</field>
<field name="arch" type="xml">
<tree default_order="location_id,product_id" editable="top" string="Inventory Details" js_class="inventory_validate_button"
decoration-danger="product_qty != theoretical_qty"
decoration-muted="product_qty == theoretical_qty"
decoration-bf="is_editable">
<field name="company_id" invisible="1"/>
<field name="product_tracking" invisible="1"/>
<field name="is_editable" invisible="1"/>
<field name="outdated" invisible="1"/>
<field name="product_id" width="1.6"
context="{'default_type': 'product'}"
readonly="context.get('default_product_id', False)"
attrs="{'readonly': ['|',
('is_editable', '=', False),
('state', '!=', 'confirm')]}"/>
<field name="location_id" groups="stock.group_stock_multi_locations"
options="{'no_create': True}"
invisible="context.get('readonly_location_id', False)"
readonly="context.get('readonly_location_id', False)"
attrs="{'readonly': ['|',
('is_editable', '=', False),
('state', '!=', 'confirm')]}"/>
<field name="inventory_date" optional="hide" width="0.8"/>
<field name="prod_lot_id" groups="stock.group_production_lot" width="0.8"
attrs="{'readonly': ['|', '|',
('product_tracking', '=', 'none'),
('is_editable', '=', False),
('state', '!=', 'confirm')]}"
context="{'default_product_id': product_id, 'default_company_id': company_id}" optional="show"/>
<field name="package_id" groups="stock.group_tracking_lot" width="0.8"
attrs="{'readonly': ['|',
('is_editable', '=', False),
('state', '!=', 'confirm')]}"
string="Package" optional="show"/>
<field name="partner_id" groups="stock.group_tracking_owner"
attrs="{'readonly': ['|',
('is_editable', '=', False),
('state', '!=', 'confirm')]}"/>
<field name="theoretical_qty" string="On Hand" width="0.5"
force_save="1" readonly="1" optional="show"/>
<button name="action_refresh_quantity" title="Refresh quantity"
icon="fa-refresh" type="object"
attrs="{'invisible': [('outdated', '=', False)]}"/>
<field name="product_qty" width="0.5" string="Counted"/>
<field name="difference_qty" optional="show" width="0.5"/>
<field name="product_uom_id" string="UoM" groups="uom.group_uom"
width="0.3" force_save="1"/>
<field name="inventory_id" invisible="1"/>
<field name="state" invisible="1"/>
</tree>
</field>
</record>
<record id="stock_inventory_line_tree_no_product_create" model="ir.ui.view">
<field name="name">stock.inventory.line.tree2</field>
<field name="model">stock.inventory.line</field>
<field name="inherit_id" ref="stock.stock_inventory_line_tree"/>
<field name="mode">primary</field>
<field name="priority">1000</field>
<field name="arch" type="xml">
<field name="product_id" position="attributes"><attribute name="options">{'no_create': True}</attribute></field>
</field>
</record>
<record id="stock_inventory_line_search" model="ir.ui.view">
<field name="name">stock.inventory.line.search</field>
<field name="model">stock.inventory.line</field>
<field name="arch" type="xml">
<search string="Search Inventory Lines">
<field name="product_id"/>
<field name="location_id" groups="stock.group_stock_multi_locations"/>
<field name="prod_lot_id" groups="stock.group_production_lot"/>
<field name="package_id" groups="stock.group_tracking_lot"/>
<field name="partner_id" groups="stock.group_tracking_owner"/>
<filter string="Outdated Theoretical Quantities"
name="outdated" domain="[('outdated', '=', True)]"/>
<filter string="Difference different than zero"
name="difference" domain="[('difference_qty', '!=', '0')]"/>
<group expand='0' string='Group by...'>
<filter string='Location' name="location" domain="[]" context="{'group_by' : 'location_id'}"/>
<filter string='Packaging' name="packaging" domain="[]" context="{'group_by' : 'package_id'}"/>
<filter string='Product' name="product" domain="[]" context="{'group_by' : 'product_id'}"/>
<filter string='Product Category' name="product_category" domain="[]" context="{'group_by' : 'categ_id'}"/>
</group>
</search>
</field>
</record>
<record id="view_inventory_filter" model="ir.ui.view">
<field name="name">stock.inventory.filter</field>
<field name="model">stock.inventory</field>
<field name="arch" type="xml">
<search string="Search Inventory">
<field name="name" string="Reference"/>
<field name="product_ids" string="Product" filter_domain="['|', ('product_ids', 'ilike', self), ('line_ids.product_id','ilike',self)]"/>
<filter string="Draft" name="draft" domain="[('state', '=', 'draft')]"/>
<filter string="In Progress" name="confirm" domain="[('state', '=', 'confirm')]"/>
<filter string="Validated" name="done" domain="[('state', '=', 'done')]"/>
<separator/>
<filter string="Inventory Date" name="inventory_date" date="date"/>
<group expand="0" string="Group By">
<filter string="Status" name="status" domain="[]" context="{'group_by': 'state'}"/>
<filter string="Inventory Date" name="inventories_month" domain="[]" context="{'group_by': 'date'}" help="Physical Inventories by Date"/>
</group>
</search>
</field>
</record>
<record id="view_inventory_tree" model="ir.ui.view">
<field name="name">stock.inventory.tree</field>
<field name="model">stock.inventory</field>
<field name="arch" type="xml">
<tree string="Lot/Serial Number Inventory" sample="1">
<field name="date"/>
<field name="name"/>
<field name="location_ids" widget="many2many_tags" optional="hide" groups="stock.group_stock_multi_locations"/>
<field name="product_ids" widget="many2many_tags" optional="hide"/>
<field name="company_id" groups="base.group_multi_company" optional="show"/>
<field name="state" widget="badge" decoration-success="state == 'done'" decoration-info="state in ('draft', 'confirm')"/>
</tree>
</field>
</record>
<record id="view_stock_inventory_kanban" model="ir.ui.view">
<field name="name">stock.inventory.kanban</field>
<field name="model">stock.inventory</field>
<field name="arch" type="xml">
<kanban class="o_kanban_mobile" sample="1">
<field name="name"/>
<field name="date"/>
<field name="state"/>
<templates>
<t t-name="kanban-box">
<div t-attf-class="oe_kanban_global_click">
<div class="o_kanban_record_top">
<div class="o_kanban_record_headings">
<strong class="o_kanban_record_title"><span><t t-esc="record.name.value"/></span></strong>
</div>
<field name="state" widget="label_selection" options="{'classes': {'draft': 'info', 'cancel': 'default', 'confirm': 'success', 'done': 'success'}}"/>
</div>
<div class="o_kanban_record_bottom">
<div class="oe_kanban_bottom_left">
</div>
<div class="oe_kanban_bottom_right">
<field name="date" widget="date"/>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id="view_inventory_form" model="ir.ui.view">
<field name="name">stock.inventory.form</field>
<field name="model">stock.inventory</field>
<field name="arch" type="xml">
<form string="Inventory Adjustment">
<header>
<button name="action_start" states="draft" string="Start Inventory" type="object" class="oe_highlight" groups="stock.group_stock_user"/>
<button name="action_open_inventory_lines" states="confirm" string="Continue Inventory" type="object" class="oe_highlight" groups="stock.group_stock_user"/>
<button name="action_validate" string="Validate Inventory" type="object" attrs="{'invisible': ['|', ('state', '!=', 'confirm'), ('line_ids', '!=', [])]}" groups="stock.group_stock_manager"/>
<button name="action_validate" string="Validate Inventory" type="object" attrs="{'invisible': ['|', ('state', '!=', 'confirm'), ('line_ids', '=', [])]}" class="oe_highlight" groups="stock.group_stock_manager"/>
<button name="action_print" string="Print Count Sheet" type="object" attrs="{'invisible': [('state', '=', 'draft')]}" groups="stock.group_stock_user"/>
<button name="action_cancel_draft" states="cancel" string="Set to Draft" type="object"/>
<button name="action_cancel_draft" states="confirm" string="Cancel Inventory" type="object"
confirm="If you cancel this inventory adjustment, all its inventory adjustment lines will be lost. Are you sure you want to discard it ?"/>
<field name="state" widget="statusbar" statusbar_visible="draft,confirm,done"/>
</header>
<sheet>
<field name="line_ids" invisible="1"/>
<div class="oe_button_box" name="button_box">
<button string="Product Moves" type="object"
name="action_view_related_move_lines"
class="oe_stat_button" icon="fa-exchange"
attrs="{'invisible': [('state', '!=', 'done')]}"
context="{'no_reference': True}"/>
</div>
<div class="oe_title">
<label for="name" class="oe_edit_only"/>
<h1><field name="name" placeholder="e.g. Annual inventory"/></h1>
</div>
<group>
<group>
<field name="location_ids" options="{'no_create': True}"
widget="many2many_tags"
force_save="1"
groups="stock.group_stock_multi_locations"/>
<field name="product_ids"
context="{'default_type': 'product'}"
widget="many2many_tags"/>
<field name="exhausted"/>
</group>
<group>
<field name="company_id" groups="base.group_multi_company" options="{'no_create': True}"/>
<field name="prefill_counted_quantity" widget="radio"
attrs="{'invisible': [('state', '!=', 'draft')]}"/>
</group>
</group>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers"/>
<field name="activity_ids" widget="mail_activity"/>
<field name="message_ids" widget="mail_thread"/>
</div>
</form>
</field>
</record>
<record id="action_inventory_form" model="ir.actions.act_window">
<field name="name">Inventory Adjustments</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">stock.inventory</field>
<field name="view_mode">tree,kanban,form</field>
<field name="view_id" ref="view_inventory_tree"/>
<field name="search_view_id" ref="view_inventory_filter"/>
<field name="help" type="html">
<p class="o_view_nocontent_barcode_scanner">
Want to speed up your inventory counts? Try our Barcode app
</p><p>
Barcode scanner can be activated via inventory settings.
Manual inventory adjustments can also be performed and pre-filled with
suggested counted quantity.
</p>
</field>
</record>
<record id="model_stock_inventory_line_action_reset_product_qty" model="ir.actions.server">
<field name="name">Set counted quantities to 0</field>
<field name="model_id" ref="model_stock_inventory_line"/>
<field name="binding_model_id" ref="model_stock_inventory_line"/>
<field name="state">code</field>
<field name="code">
if records:
action = records.action_reset_product_qty()
</field>
</record>
<record id="model_stock_inventory_line_action_recompute_quantity" model="ir.actions.server">
<field name="name">Recompute On Hand Quantity</field>
<field name="model_id" ref="model_stock_inventory_line"/>
<field name="binding_model_id" ref="model_stock_inventory_line"/>
<field name="state">code</field>
<field name="code">
if records:
action = records.action_refresh_quantity()
</field>
</record>
<menuitem action="action_inventory_form" id="menu_action_inventory_form" parent="menu_stock_warehouse_mgmt" sequence="30"/>
</odoo>
|