1
<?xml version="1.0" encoding="utf-8" ?>
5
<record id="real_average_consumption_form_view" model="ir.ui.view">
6
<field name="name">real.average.consumption.form.view</field>
7
<field name="model">real.average.consumption</field>
8
<field name="type">form</field>
9
<field name="arch" type="xml">
10
<form string="Real consumption reporting">
11
<group colspan="4" col="6">
12
<field name="id" invisible="1" />
13
<separator colspan="6" string="General information" />
14
<field name="name" readonly="1" colspan="3" />
15
<field name="creation_date" attrs="{'readonly': [('created_ok', '=', True)]}" colspan="2"/>
16
<field name="cons_location_id" attrs="{'readonly': ['|', ('id', '!=', 0), ('created_ok', '=', True)]}" context="{'no3buttons': True}" colspan="2"/>
17
<button name="change_cons_location_id" string="Change location" icon="gtk-preferences" type="object" attrs="{'readonly': ['|', ('id', '=', 0), ('created_ok', '=', True)]}" />
18
<group colspan="3" col="2">
19
<field name="picking_id" attrs="{'invisible': [('created_ok', '=', False)]}" />
20
<button name="import_rac" colspan="2" string="Import a file" icon="gtk-leave-fullscreen" type="object" attrs="{'invisible': [('created_ok', '=', True)]}"/>
22
<field name="activity_id" attrs="{'readonly': [('created_ok', '=', True)]}" colspan="3"/>
23
<button name="export_rac" colspan="3" string="Export lines" icon="terp-mail-forward" type="object" />
24
<separator colspan="6" string="Period of consumption" />
25
<field name="period_from" attrs="{'readonly': [('created_ok', '=', True)]}" colspan="3"/>
26
<field name="period_to" attrs="{'readonly': [('created_ok', '=', True)]}" colspan="3"/>
27
<group colspan="6" col="6" name="import" string="Import lines">
28
<button name="add_multiple_lines" string="Add multiple lines" type="object" icon="gtk-add" colspan="3" />
29
<button name="button_remove_lines" string="Delete Lines" icon="gtk-remove" colspan="3" type="object" />
32
<separator colspan="4" string="Products" />
33
<button name="button_remove_lines" string="Remove lines" icon="gtk-remove" type="object"
34
confirm="Are you sure that you want to remove all lines?" invisible="1"/>
35
<field name="hide_column_error_ok" invisible="1" />
36
<field colspan="4" name="line_ids" mode="tree" nolabel="1" widget="one2many_list" attrs="{'readonly': [('created_ok', '=', True)]}"
37
context="{'hide_column_error_ok': hide_column_error_ok, 'active_id': active_id}">
38
<tree string="Products" editable="top" colors="red: consumed_qty>0 and (inactive_product or to_correct_ok or consumed_qty > product_qty or (batch_mandatory and not prodlot_id) or (date_mandatory and not expiry_date));blue: not prodlot_id and consumed_qty>product_qty and not to_correct_ok and not inactive_product">
39
<field name="product_id" on_change="product_onchange(product_id, parent.cons_location_id, uom_id, prodlot_id)"
40
context="{'location': parent.cons_location_id, 'compute_child': False, 'available_for_restriction': 'consumption', 'search_default_not_restricted': 1}" />
41
<!-- domain="[('list_ids', '=', parent.sublist_id)]" /> -->
43
on_change="uom_onchange(product_id, consumed_qty, parent.cons_location_id, uom_id, prodlot_id)"/>
44
<field name="product_qty" />
45
<field name="prodlot_id"
46
on_change="change_prodlot(product_id, prodlot_id, expiry_date, parent.cons_location_id, uom_id, remark)"
47
domain="[('product_id', '=', product_id), ('stock_available', '>', 0)]"
48
context="{'location_id': parent.cons_location_id, 'uom': uom_id, 'hidden_perishable_mandatory': not batch_mandatory}"
49
attrs="{'required': [('batch_mandatory', '=', True)], 'readonly': [('date_mandatory', '=', False), ('batch_mandatory', '=', False)]}" />
50
<field name="expiry_date"
51
on_change="change_expiry(expiry_date, product_id, parent.cons_location_id, uom_id, remark)"
52
attrs="{'required': [('date_mandatory', '=', True), ('batch_mandatory', '=', False)], 'readonly': ['|', ('batch_mandatory', '=', True), ('date_mandatory', '=', False)]}"/>
53
<field name="asset_id"
54
attrs="{'required': [('asset_mandatory', '=', True)], 'readonly': [('asset_mandatory', '=', False)]}"
55
on_change="change_asset(asset_id, product_id, parent.cons_location_id, uom_id, remark)"
56
domain="[('product_id', '=', product_id)]" />
57
<field name="consumed_qty" on_change="change_qty(consumed_qty, product_id, prodlot_id, parent.cons_location_id, uom_id)"/>
58
<field name="move_id" invisible="1" />
59
<button string="Duplicate line" icon="terp-stock_effects-object-colorize" name="copy" type="object" attrs="{'invisible': [('move_id', '!=', False)]}" />
60
<field name="remark" invisible="1" />
61
<field name="batch_mandatory" invisible="0" string="B.Num" readonly="1" />
62
<field name="date_mandatory" invisible="0" string="Exp" readonly="1" />
63
<field name="asset_mandatory" invisible="0" string="Asset" readonly="1" />
64
<field name="to_correct_ok" invisible="1"/>
65
<field name="text_error" invisible="context.get('hide_column_error_ok', False) != True" />
66
<field name="inactive_product" invisible="1" />
67
<field name="inactive_error" readonly="1" />
70
<field name="created_ok" invisible="1" />
71
<group colspan="4" col="6">
72
<button name="button_update_stock" string="Update Indicative Stock" icon="gtk-refresh" colspan="2" type="object" attrs="{'invisible': [('state','!=','draft')]}" />
73
<button name="cancel_button" string="Cancel" icon="gtk-cancel" type="object" colspan="2" attrs="{'invisible': [('state', '!=', 'draft')]}" />
74
<button name="process_moves" string="Save & Process" icon="gtk-execute" type="object" colspan="2" attrs="{'invisible': [('state','!=','draft')]}" />
75
<button name="draft_button" string="Draft" icon="gtk-apply" type="object" colspan="2" attrs="{'invisible': [('state', '!=', 'cancel')]}" />
78
<field name="state" />
84
<record id="real_average_consumption_confirmation_view" model="ir.ui.view">
85
<field name="name">real.average.consumption.confirmation.view</field>
86
<field name="model">real.average.consumption</field>
87
<field name="type">form</field>
88
<field name="priority" eval="99" />
89
<field name="arch" type="xml">
90
<form string="Need confirmation">
91
<separator colspan="4" string="Actions" />
92
<button name="process_moves" string="Process moves" icon="gtk-execute" type="object" colspan="2" />
97
<record id="real_average_consumption_tree_view" model="ir.ui.view">
98
<field name="name">real.average.consumption.tree.view</field>
99
<field name="model">real.average.consumption</field>
100
<field name="type">tree</field>
101
<field name="arch" type="xml">
102
<tree string="Real consumption reports">
103
<field name="name" />
104
<field name="cons_location_id" />
105
<field name="activity_id" />
106
<field name="period_from" />
107
<field name="period_to" />
108
<field name="nb_lines" />
109
<field name="created_ok" />
110
<field name="state" />
111
<field name="sublist_id" invisible="1" />
112
<field name="nomen_manda_0" invisible="1" />
113
<field name="nomen_manda_1" invisible="1" />
114
<field name="nomen_manda_2" invisible="1" />
115
<field name="nomen_manda_3" invisible="1" />
120
<record id="real_average_consumption_search_view" model="ir.ui.view">
121
<field name="name">real.average.consumption.search.view</field>
122
<field name="model">real.average.consumption</field>
123
<field name="type">search</field>
124
<field name="arch" type="xml">
125
<search string="Real consumption reports">
126
<group col="10" colspan="4">
127
<filter icon="terp-check" string="Closed" domain="[('created_ok','=',True)]"/>
128
<separator orientation="vertical"/>
129
<field name="cons_location_id"/>
130
<field name="activity_id"/>
131
<field name="period_from"/>
132
<field name="period_to"/>
135
<group expand="0" string="Group By...">
136
<filter string="Consumer" icon="terp-stock" domain="[]" context="{'group_by': 'cons_location_id'}" />
137
<filter string="Activity" icon="terp-administration" domain="[]" context="{'group_by':'activity_id'}"/>
138
<separator orientation="vertical"/>
139
<filter string="Sublist" icon="terp-go-week" domain="[]" context="{'group_by':'sublist_id'}"/>
140
<filter string="Main type" icon="terp-tools" domain="[]" context="{'group_by':'nomen_manda_0'}"/>
141
<filter string="Group" icon="terp-tools" domain="[]" context="{'group_by':'nomen_manda_1'}"/>
142
<filter string="Family" icon="terp-tools" domain="[]" context="{'group_by':'nomen_manda_2'}"/>
143
<filter string="Root" icon="terp-tools" domain="[]" context="{'group_by':'nomen_manda_3'}"/>
149
<record id="action_real_average_consumption" model="ir.actions.act_window">
150
<field name="name">Real consumption</field>
151
<field name="res_model">real.average.consumption</field>
152
<field name="view_type">form</field>
153
<field name="view_mode">tree,form</field>
154
<field name="context">{'withnum': 1}</field>
157
<record id="action_new_real_consumption_report" model="ir.actions.act_window">
158
<field name="name">New real consumption report</field>
159
<field name="res_model">real.average.consumption</field>
160
<field name="view_type">form</field>
161
<field name="view_mode">form</field>
162
<field name="target">new</field>
166
id="warehouse_consumption_menu"
167
name="Consumption reports"
169
parent="stock.next_id_61" />
172
id="consumption_reports_menu"
173
action="action_real_average_consumption"
174
parent="warehouse_consumption_menu" />
176
<record id="monthly_review_consumption_form_view" model="ir.ui.view">
177
<field name="name">monthly.review.consumption.form.view</field>
178
<field name="model">monthly.review.consumption</field>
179
<field name="type">form</field>
180
<field name="arch" type="xml">
181
<form string="Monthly consumption">
182
<separator colspan="4" string="General information" />
183
<field name="period_from" on_change="period_change(period_from, period_to)" />
184
<!-- uf-1344 => we replace the import export of csv by import export of xml file (Excel compatibility). (see msf_doc_import) -->
185
<button name="import_fmc" string="Import a file" icon="gtk-leave-fullscreen" type="object" colspan="2" />
186
<field name="period_to" on_change="period_change(period_from, period_to)" />
187
<!-- uf-1344 => we replace the import export of csv by import export of xml file (Excel compatibility). (see msf_doc_import) -->
188
<button name="export_fmc" string="Export lines" icon="terp-mail-forward" type="object" colspan="2" />
189
<field name="cons_location_id" />
191
<separator colspan="4" string="Products" />
192
<group colspan="4" col="4" name="import" string="Import lines">
193
<button name="add_multiple_lines" string="Add multiple lines" type="object" icon="gtk-add" colspan="2" />
194
<button name="button_remove_lines" string="Delete Lines" icon="gtk-remove" colspan="2" type="object" />
196
<button name="button_remove_lines" string="Remove lines" icon="gtk-remove" type="object"
197
confirm="Are you sure that you want to remove all lines?" invisible="1"/>
198
<field name="hide_column_error_ok" invisible="1" />
199
<field colspan="4" name="line_ids" mode="tree" nolabel="1" widget="one2many_list"
200
context="{'hide_column_error_ok': hide_column_error_ok, 'active_id': active_id}">
201
<tree string="Products" editable="top" colors="red: to_correct_ok==True">
202
<field name="name" on_change="product_onchange(name, parent.id, parent.period_from, parent.period_to)" />
204
<field name="fmc" on_change="fmc_change(amc, fmc, name)" attrs="{'readonly': [('valid_ok', '=', True)]}" />
205
<field name="last_reviewed" />
206
<field name="valid_ok" />
207
<field name="valid_until" />
208
<field name="fmc2" invisible="1" />
209
<field name="last_reviewed2" invisible="1" />
210
<button name="display_graph" type="object" string="Display graph" icon="terp-purchase" />
211
<field name="to_correct_ok" invisible="1"/>
212
<field name="text_error" invisible="context.get('hide_column_error_ok', False) != True" />
215
<button colspan="4" icon="gtk-execute" string="Valid all lines" type="object" name="valid_multiple_lines" />
220
<record id="monthly_review_consumption_tree_view" model="ir.ui.view">
221
<field name="name">monthly.review.consumption.tree.view</field>
222
<field name="model">monthly.review.consumption</field>
223
<field name="type">tree</field>
224
<field name="arch" type="xml">
225
<tree string="Monthly consumption">
226
<field name="period_from" />
227
<field name="period_to" />
228
<field name="nb_lines" />
229
<field name="sublist_id" invisible="1" />
230
<field name="nomen_manda_0" invisible="1" />
231
<field name="nomen_manda_1" invisible="1" />
232
<field name="nomen_manda_2" invisible="1" />
233
<field name="nomen_manda_3" invisible="1" />
238
<record id="monthly_review_consumption_search_view" model="ir.ui.view">
239
<field name="name">monthly.review.consumption.search.view</field>
240
<field name="model">monthly.review.consumption</field>
241
<field name="type">search</field>
242
<field name="arch" type="xml">
243
<search string="Monthly consumption">
244
<group col="10" colspan="4">
245
<field name="period_from"/>
246
<field name="period_to"/>
249
<group expand="0" string="Group By...">
250
<filter string="Sublist" icon="terp-go-week" domain="[]" context="{'group_by':'sublist_id'}"/>
251
<filter string="Main type" icon="terp-tools" domain="[]" context="{'group_by':'nomen_manda_0'}"/>
252
<filter string="Group" icon="terp-tools" domain="[]" context="{'group_by':'nomen_manda_1'}"/>
253
<filter string="Family" icon="terp-tools" domain="[]" context="{'group_by':'nomen_manda_2'}"/>
254
<filter string="Root" icon="terp-tools" domain="[]" context="{'group_by':'nomen_manda_3'}"/>
260
<record id="action_monthly_review_consumption" model="ir.actions.act_window">
261
<field name="name">Monthly consumption</field>
262
<field name="res_model">monthly.review.consumption</field>
263
<field name="view_type">form</field>
264
<field name="view_mode">tree,form</field>
265
<field name="context">{'withnum': 1}</field>
268
<record id="action_new_monthly_review_consumption" model="ir.actions.act_window">
269
<field name="name">New real monthly consumption</field>
270
<field name="res_model">monthly.review.consumption</field>
271
<field name="view_type">form</field>
272
<field name="view_mode">form</field>
273
<field name="target">new</field>
277
id="consumption_monthly_review_menu"
278
action="action_monthly_review_consumption"
279
parent="warehouse_consumption_menu" />
281
<record id="monthly_cons_product_form_view" model="ir.ui.view">
282
<field name="name">monthlu.cons.product.form.view</field>
283
<field name="model">product.product</field>
284
<field name="type">form</field>
285
<field name="inherit_id" ref="product.product_normal_form_view" />
286
<field name="arch" type="xml">
288
<field name="produce_delay" position="after">
289
<field name="procure_delay" />
295
<record id="monthly_cons_stock_product_form_view" model="ir.ui.view">
296
<field name="name">monthlu.cons.product.stock.form.view</field>
297
<field name="model">product.product</field>
298
<field name="type">form</field>
299
<field name="inherit_id" ref="stock.view_normal_stock_property_form" />
300
<field name="arch" type="xml">
301
<field name="virtual_available" position="after">
302
<field name="product_amc" readonly="1" />
303
<field name="reviewed_consumption" />
308
<record id="view_stock_location_search_without_buttons" model="ir.ui.view">
309
<field name="name">stock.location.search.without_buttons</field>
310
<field name="model">stock.location</field>
311
<field name="type">search</field>
312
<field name="arch" type="xml">
313
<search string="Stock Locations">
314
<field name="name" />
315
<field name="location_category" />
320
<!-- REAL AVERAGE CONSUMPTION -->
322
id="report_real_consumption_xls"
323
string="Real Consumption Excel Export"
324
model="real.average.consumption"
325
name="real.consumption.xls"
326
file="consumption_calculation/report/report_real_consumption_xls.mako"
333
<!-- MONTHLY REVIEW CONSUMPTION -->
335
id="report_monthly_consumption_xls"
336
string="Monthly Consumption Excel Export"
337
model="monthly.review.consumption"
338
name="monthly.consumption.xls"
339
file="consumption_calculation/report/report_monthly_consumption_xls.mako"
346
<record id="view_real_consumption_change_location" model="ir.ui.view">
347
<field name="name">real.consumption.change.location.form.view</field>
348
<field name="model">real.consumption.change.location</field>
349
<field name="type">form</field>
350
<field name="arch" type="xml">
351
<form string="Change location">
352
<separator colspan="4" string="New location" />
353
<label colspan="4" string="Are you sure you want to change the consumer location ? It will change the indicative stock, so please check the report lines before validating" />
354
<label colspan="4" string=" "/>
355
<field name="location_id" required="1" domain="[('usage', '=', 'internal')]" />
356
<separator colspan="4" string="Actions" />
357
<label colspan="2"> </label>
358
<button special="cancel" string="Cancel" icon="gtk-cancel" />
359
<button name="change_location" string="Change location" type="object" icon="gtk-preferences" />