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
|
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_stock_warehouse_orderpoint_kanban" model="ir.ui.view">
<field name="name">stock.warehouse.orderpoint.kanban</field>
<field name="model">stock.warehouse.orderpoint</field>
<field name="arch" type="xml">
<kanban class="o_kanban_mobile">
<field name="name"/>
<field name="product_id"/>
<field name="trigger"/>
<field name="product_min_qty"/>
<field name="product_max_qty"/>
<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"><t t-esc="record.name.value"/></strong>
</div>
<span class="badge badge-pill"><strong>Min qty :</strong><t t-esc="record.product_min_qty.value"/></span>
</div>
<div class="o_kanban_record_bottom">
<div class="oe_kanban_bottom_left">
<span><t t-esc="record.product_id.value"/></span>
</div>
<div class="oe_kanban_bottom_right">
<span class="badge badge-pill"><strong>Max qty :</strong><t t-esc="record.product_max_qty.value"/></span>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id="view_warehouse_orderpoint_tree_editable" model="ir.ui.view">
<field name="name">stock.warehouse.orderpoint.tree.editable</field>
<field name="model">stock.warehouse.orderpoint</field>
<field name="arch" type="xml">
<tree string="Reordering Rules" editable="bottom" js_class="stock_orderpoint_list" sample="1">
<field name="active" invisible="1"/>
<field name="allowed_route_ids" invisible="1"/>
<field name="product_category_id" invisible="1"/>
<field name="product_tmpl_id" invisible="1"/>
<field name="product_id" attrs="{'readonly': [('product_id', '!=', False)]}" invisible="context.get('default_product_id')" force_save="1"/>
<field name="location_id" options="{'no_create': True}" groups="stock.group_stock_multi_locations"/>
<field name="warehouse_id" options="{'no_create': True}" groups="stock.group_stock_multi_warehouses" optional="hide"/>
<field name="qty_on_hand" force_save="1"/>
<field name="qty_forecast" force_save="1"/>
<field name="json_lead_days_popover" optional="show" nolabel="1" string="Forecast Description" width="10px" widget="popover_widget" attrs="{'invisible': [('id', '=', False)]}"/>
<field name="route_id" options="{'no_create': True, 'no_open': True}"/>
<field name="trigger" optional="hide"/>
<field name="product_min_qty" optional="show"/>
<field name="product_max_qty" optional="show"/>
<field name="qty_multiple" optional="hide"/>
<field name="qty_to_order"/>
<field name="product_uom_name" string="UoM" groups="uom.group_uom"/>
<field name="company_id" optional="hide" readonly="1" groups="base.group_multi_company"/>
<button name="action_replenish" string="Order Once" type="object" class="o_replenish_buttons" icon="fa-truck"
attrs="{'invisible': [('qty_to_order', '<', 1.0)]}"/>
<button name="action_replenish_auto" string="Automate Orders" type="object" class="o_replenish_buttons" icon="fa-refresh"
attrs="{'invisible': ['|', ('qty_to_order', '<', 1.0), ('trigger', '=', 'auto')]}"/>
<button name="%(action_orderpoint_snooze)d" string="Snooze" type="action" class="text-warning" icon="fa-bell-slash"
attrs="{'invisible': [('trigger', '!=', 'manual')]}" context="{'default_orderpoint_ids': [id]}"/>
</tree>
</field>
</record>
<record id="view_warehouse_orderpoint_tree_editable_config" model="ir.ui.view">
<field name="name">stock.warehouse.orderpoint.tree.editable.config</field>
<field name="model">stock.warehouse.orderpoint</field>
<field name="arch" type="xml">
<tree string="Reordering Rules" editable="bottom">
<field name="active" invisible="1"/>
<field name="allowed_route_ids" invisible="1"/>
<field name="warehouse_id" invisible="1"/>
<field name="product_tmpl_id" invisible="1"/>
<field name="product_id" invisible="context.get('default_product_id')" force_save="1"/>
<field name="location_id" options="{'no_create': True}" groups="stock.group_stock_multi_locations"/>
<field name="route_id" optional="hide"/>
<field name="trigger" optional="hide"/>
<field name="product_min_qty" optional="show"/>
<field name="product_max_qty" optional="show"/>
<field name="qty_multiple" optional="show"/>
<field name="json_lead_days_popover" optional="show" nolabel="1" string="Forecast Description" width="10px" widget="popover_widget" attrs="{'invisible': [('id', '=', False)]}"/>
<field name="product_uom_name" string="UoM" groups="uom.group_uom"/>
<field name="company_id" optional="hide" readonly="1" groups="base.group_multi_company"/>
</tree>
</field>
</record>
<record model="ir.ui.view" id="stock_reorder_report_search">
<field name="name">stock.warehouse.orderpoint.reorder.search</field>
<field name="model">stock.warehouse.orderpoint</field>
<field name="arch" type="xml">
<search string="Replenishment Report Search">
<field name="name" string="Reordering Rule"/>
<field name="product_id"/>
<field name="trigger"/>
<field name="product_category_id"/>
<field name="warehouse_id" groups="stock.group_stock_multi_warehouses"/>
<field name="location_id" groups="stock.group_stock_multi_locations"/>
<filter string="To Reorder" name="filter_to_reorder" domain="[('qty_to_order', '>', 0.0)]"/>
<separator/>
<filter string="Not Snoozed" name="filter_not_snoozed" domain="['|', ('snoozed_until', '=', False), ('snoozed_until', '<=', datetime.date.today().strftime('%Y-%m-%d'))]"/>
<group expand="0" string="Group By">
<filter string="Warehouse" name="groupby_warehouse" domain="[]" context="{'group_by': 'warehouse_id'}" groups="stock.group_stock_multi_warehouses"/>
<filter string="Location" name="groupby_location" domain="[]" context="{'group_by': 'location_id'}" groups="stock.group_stock_multi_locations"/>
<filter string="Product" name="groupby_product" domain="[]" context="{'group_by': 'product_id'}"/>
<filter string="Category" name="groupby_category" domain="[]" context="{'group_by': 'product_category_id'}"/>
</group>
</search>
</field>
</record>
<record model="ir.ui.view" id="warehouse_orderpoint_search">
<field name="name">stock.warehouse.orderpoint.search</field>
<field name="model">stock.warehouse.orderpoint</field>
<field name="arch" type="xml">
<search string="Reordering Rules Search">
<field name="name" string="Reordering Rule"/>
<field name="product_id"/>
<field name="trigger"/>
<field name="warehouse_id" groups="stock.group_stock_multi_warehouses"/>
<field name="location_id" groups="stock.group_stock_multi_locations"/>
<filter string="Archived" name="inactive" domain="[('active', '=', False)]"/>
<group expand="0" string="Group By">
<filter string="Warehouse" name="warehouse" domain="[]" context="{'group_by': 'warehouse_id'}" groups="stock.group_stock_multi_warehouses"/>
<filter string="Location" name="location" domain="[]" context="{'group_by': 'location_id'}" groups="stock.group_stock_multi_locations"/>
<filter string="Product" name="product" domain="[]" context="{'group_by': 'product_id'}"/>
</group>
</search>
</field>
</record>
<record id="view_warehouse_orderpoint_form" model="ir.ui.view">
<field name="name">stock.warehouse.orderpoint.form</field>
<field name="model">stock.warehouse.orderpoint</field>
<field name="arch" type="xml">
<form string="Reordering Rules">
<div class="alert alert-info" role="alert">
<a style="cursor: pointer" class="alert-link o_form_uri" type="action" name="%(action_procurement_compute)d">Run the scheduler</a> manually to trigger the reordering rules right now.
</div>
<sheet>
<widget name="web_ribbon" title="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/>
<div class="oe_title">
<h1>
<field name="name"/>
</h1>
</div>
<group>
<group>
<field name="active" invisible="1"/>
<field name="product_id"/>
<label for="product_min_qty"/>
<div class="o_row">
<field name="product_min_qty"/>
<field name="product_uom_name"/>
<field name="json_lead_days_popover" widget="popover_widget" attrs="{'invisible': [('id', '=', False)]}"/>
</div>
<label for="product_max_qty"/>
<div class="o_row">
<field name="product_max_qty"/>
<field name="product_uom_name"/>
</div>
<field name="qty_multiple" string="Quantity Multiple"/>
</group>
<group>
<field name="allowed_location_ids" invisible="1"/>
<field name="warehouse_id" widget="selection" groups="stock.group_stock_multi_locations"/>
<field name="location_id" options="{'no_create': True}" groups="stock.group_stock_multi_locations" domain="[('id', 'in', allowed_location_ids)]"/>
<label for="group_id" groups="base.group_no_one"/>
<div groups="base.group_no_one">
<field name="group_id" groups="stock.group_adv_location"/>
</div>
<field name="company_id" groups="base.group_multi_company" options="{'no_create': True}"/>
</group>
</group>
</sheet>
</form>
</field>
</record>
<record id="action_orderpoint_replenish" model="ir.actions.act_window">
<field name="name">Replenishment</field>
<field name="res_model">stock.warehouse.orderpoint</field>
<field name="type">ir.actions.act_window</field>
<field name="view_mode">tree</field>
<field name="view_id" ref="view_warehouse_orderpoint_tree_editable"/>
<field name="search_view_id" ref="stock_reorder_report_search"/>
<field name="help" type="html">
<p class="o_view_nocontent_replenishment">
You are good, no replenishment to perform!
</p><p>
You'll find here smart replenishment propositions based on inventory forecasts.
Choose the quantity to buy or manufacture and launch orders in a click.
To save time in the future, set the rules as "automated".
</p>
</field>
</record>
<record id="action_orderpoint" model="ir.actions.act_window">
<field name="name">Reordering Rules</field>
<field name="res_model">stock.warehouse.orderpoint</field>
<field name="type">ir.actions.act_window</field>
<field name="view_mode">tree,kanban,form</field>
<field name="view_id" ref="view_warehouse_orderpoint_tree_editable_config"/>
<field name="search_view_id" ref="warehouse_orderpoint_search"/>
<field name="context">{'search_default_trigger': 'auto'}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
No reordering rule found
</p><p>
Define a minimum stock rule so that Odoo creates automatically requests for quotations or draft manufacturing orders to resupply your stock.
</p>
</field>
</record>
<record model="ir.actions.server" id="action_replenishment">
<field name="name">Replenishment</field>
<field name="model_id" ref="model_stock_warehouse_orderpoint"/>
<field name="state">code</field>
<field name="code">
action = model.with_context(
search_default_trigger='manual',
search_default_filter_to_reorder=True,
search_default_filter_not_snoozed=True,
default_trigger='manual'
).action_open_orderpoints()
</field>
</record>
<menuitem
id="menu_reordering_rules_replenish"
action="action_replenishment"
name="Replenishment" parent="menu_stock_warehouse_mgmt" sequence="10"
groups="stock.group_stock_manager"/>
<menuitem
id="menu_reordering_rules_config"
action="action_orderpoint"
name="Reordering Rules" parent="menu_product_in_config_stock" sequence="10"/>
</odoo>
|