-
-
Notifications
You must be signed in to change notification settings - Fork 729
/
Copy pathstock_inventory.xml
204 lines (198 loc) · 8.81 KB
/
stock_inventory.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
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
<odoo>
<record id="view_inventory_group_form" model="ir.ui.view">
<field name="name">stock.inventory.form.view</field>
<field name="model">stock.inventory</field>
<field name="priority">1000</field>
<field name="arch" type="xml">
<form>
<header>
<button
type="object"
name="action_state_to_in_progress"
class="oe_highlight"
invisible="state in ('in_progress', 'done')"
string="Begin Adjustments"
/>
<button
type="object"
name="action_state_to_draft"
invisible="state in ('draft', 'done') or count_stock_moves != 0"
string="Back to Draft"
/>
<field name="action_state_to_cancel_allowed" invisible="1" />
<button
type="object"
name="action_state_to_cancel"
invisible="not action_state_to_cancel_allowed"
string="Cancel"
/>
<button
type="object"
name="action_state_to_done"
class="oe_highlight"
invisible="state in ('draft', 'done')"
string="Set to Done"
/>
<field
name="state"
widget="statusbar"
statusbar_visible="draft,in_progress,done"
/>
</header>
<sheet>
<div class="oe_button_box" name="button_box">
<button
type="object"
name="action_view_inventory_adjustment"
class="oe_stat_button"
icon="fa-pencil-square-o"
invisible="state in ('draft', 'done')"
>
<field
name="count_stock_quants_string"
widget="statinfo"
readonly="1"
/>
<field invisible="True" name="count_stock_quants" />
</button>
<button
type="object"
name="action_view_stock_moves"
class="oe_stat_button"
icon="fa-cubes"
invisible="state == 'draft' or count_stock_moves == 0"
>
<field
name="count_stock_moves"
widget="statinfo"
readonly="1"
/>
</button>
</div>
<div class="oe_title" name="title">
<label for="name" class="oe_edit_only" />
<h1><field
name="name"
placeholder="e.g. Annual inventory"
readonly="state != 'draft'"
/></h1>
</div>
<group>
<group>
<field
name="product_selection"
widget="radio"
readonly="state != 'draft'"
/>
<field
name="location_ids"
string="Locations"
widget="many2many_tags"
required="1"
readonly="state != 'draft'"
/>
<field
name="exclude_sublocation"
readonly="state in ['in_progress', 'done']"
required="1"
/>
</group>
<group>
<field name="date" readonly="state != 'draft'" />
<field name="company_id" readonly="state != 'draft'" />
<field name="responsible_id" readonly="state != 'draft'" />
<field name="owner_id" readonly="state != 'draft'" />
<field
name="product_ids"
widget="many2many_tags"
readonly="state != 'draft'"
required="product_selection in ['manual', 'lot']"
invisible="product_selection in ['all', 'category', 'one']"
/>
<field
name="product_ids"
widget="many2many_tags"
options="{'limit': 10}"
required="product_selection == 'one'"
invisible="product_selection != 'one'"
readonly="state != 'draft'"
/>
<field
name="category_id"
required="product_selection == 'category'"
invisible="product_selection != 'category'"
readonly="state != 'draft'"
/>
<field
name="lot_ids"
widget="many2many_tags"
domain="[('product_id', 'in', product_ids)]"
readonly="state in ['in_progress', 'done']"
required="product_selection == 'lot'"
invisible="product_selection != 'lot'"
/>
</group>
</group>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers" />
<field name="message_ids" widget="mail_thread" />
</div>
</form>
</field>
</record>
<record id="view_inventory_group_tree" model="ir.ui.view">
<field name="name">stock.inventory.tree.view</field>
<field name="model">stock.inventory</field>
<field name="priority">1000</field>
<field name="arch" type="xml">
<tree>
<field name="name" />
<field name="product_selection" optional="hide" />
<field name="location_ids" widget="many2many_tags" optional="hide" />
<field name="responsible_id" optional="hide" />
<field
name="state"
widget="badge"
decoration-success="state == 'done'"
decoration-info="state not in ('done', 'draft')"
decoration-muted="state == 'draft'"
/>
<field name="date" />
<field name="company_id" optional="hide" />
</tree>
</field>
</record>
<record model="ir.ui.view" id="stock_inventory_search_view">
<field name="model">stock.inventory</field>
<field name="arch" type="xml">
<search>
<field name="name" />
<field name="location_ids" />
<field name="date" />
<field name="state" />
<field name="product_ids" string="Product" />
<field
name="products_under_review_ids"
string="Products Under Review"
/>
</search>
</field>
</record>
<record id="action_view_inventory_group_form" model="ir.actions.act_window">
<field name="name">Inventory Adjustment Group</field>
<field name="res_model">stock.inventory</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_inventory_group_tree" />
</record>
<menuitem
id="menu_action_inventory_tree"
name="Inventory Adjustments"
parent="stock.menu_stock_adjustments"
sequence="30"
action="action_view_inventory_group_form"
/>
<record id="stock.menu_action_inventory_tree" model="ir.ui.menu">
<field name="active" eval="False" />
</record>
</odoo>