8
8
<field name="type">form</field>
9
9
<field name="arch" type="xml">
10
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': ['|', ('state', '=', 'cancel'), ('created_ok', '=', True)]}" colspan="2"/>
16
<field name="cons_location_id" attrs="{'readonly': ['|', '|', ('state', '=', 'cancel'), ('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': ['|', '|', ('state', '=', 'cancel'), ('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': ['|', ('state', '=', 'cancel'), ('created_ok', '=', True)]}"/>
22
<field name="activity_id" attrs="{'readonly': ['|', ('state', '=', 'cancel'), ('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': ['|', ('state', '=', 'cancel'), ('created_ok', '=', True)]}" colspan="3"/>
26
<field name="period_to" attrs="{'readonly': ['|', ('state', '=', 'cancel'), ('created_ok', '=', True)]}" colspan="3"/>
27
<group colspan="6" col="6" name="import" string="Import lines" attrs="{'invisible': ['|', ('state', '=', 'cancel'), ('created_ok', '=', True)]}">
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" />
11
<separator colspan="4" string="General information" />
12
<field name="name" readonly="1" />
13
<field name="creation_date" attrs="{'readonly': [('created_ok', '=', True)]}"/>
14
<field name="cons_location_id" attrs="{'readonly': [('created_ok', '=', True)]}" context="{'no3buttons': True}"/>
15
<group colspan="2" col="2">
16
<field name="picking_id" attrs="{'invisible': [('created_ok', '=', False)]}" />
17
<button name="import_rac" colspan="2" string="Import a file" icon="gtk-leave-fullscreen" type="object" attrs="{'invisible': [('created_ok', '=', True)]}"/>
19
<field name="activity_id" attrs="{'readonly': [('created_ok', '=', True)]}"/>
20
<button name="export_rac" colspan="2" string="Export lines" icon="terp-mail-forward" type="object" />
21
<separator colspan="4" string="Period of consumption" />
22
<field name="period_from" attrs="{'readonly': [('created_ok', '=', True)]}"/>
23
<field name="period_to" attrs="{'readonly': [('created_ok', '=', True)]}"/>
24
<separator colspan="4" string="Product filters" />
25
<field name="sublist_id" attrs="{'readonly': ['|',('created_ok', '=', True), ('nomen_manda_0', '!=', False)]}"/>
27
<group colspan="2" col="4" attrs="{'readonly': [('sublist_id', '!=', False)]}">
28
<field name="nomen_manda_0"
29
domain="[('level', '=', '0'), ('type', '=', 'mandatory')]"
31
on_change="onChangeSearchNomenclature(0, 'mandatory', nomen_manda_0, nomen_manda_1, nomen_manda_2, nomen_manda_3, False)"
33
<field name="nomen_manda_1"
34
domain="[('id','=', 0)]"
36
get_selection="get_nomen"
37
on_change="onChangeSearchNomenclature(1, 'mandatory', nomen_manda_0, nomen_manda_1, nomen_manda_2, nomen_manda_3, False)"
39
<field name="nomen_manda_2"
40
domain="[('id','=', 0)]"
42
get_selection="get_nomen"
43
on_change="onChangeSearchNomenclature(2, 'mandatory', nomen_manda_0, nomen_manda_1, nomen_manda_2, nomen_manda_3, False)"
45
<field name="nomen_manda_3"
46
domain="[('id','=', 0)]"
48
get_selection="get_nomen"
49
on_change="onChangeSearchNomenclature(3, 'mandatory', nomen_manda_0, nomen_manda_1, nomen_manda_2, nomen_manda_3, False)"
53
<button colspan="4" icon="gtk-go-down" string="Fill lines" type="object" name="fill_lines" attrs="{'invisible': [('created_ok', '=', True)]}" />
32
54
<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
<button colspan="4" icon="gtk-go-down" string="Copy all" type="object" name="copy_all" attrs="{'invisible': ['|', ('state', '=', 'cancel'), ('created_ok', '=', True)]}" />
36
<field name="hide_column_error_ok" invisible="1" />
37
<field colspan="4" name="line_ids" mode="tree" nolabel="1" widget="one2many_list" attrs="{'readonly': ['|', ('state', '=', 'cancel'), ('created_ok', '=', True)]}"
38
context="{'hide_column_error_ok': hide_column_error_ok, 'active_id': active_id}">
39
<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">
55
<field colspan="4" name="line_ids" mode="tree" nolabel="1" widget="one2many_list" attrs="{'readonly': [('created_ok', '=', True)]}">
56
<tree string="Products" editable="top" colors="red:prodlot_id and consumed_qty>product_qty or not prodlot_id and batch_mandatory;blue: not prodlot_id and consumed_qty>product_qty">
40
57
<field name="product_id" on_change="product_onchange(product_id, parent.cons_location_id, uom_id, prodlot_id)"
41
context="{'location': parent.cons_location_id, 'compute_child': False, 'available_for_restriction': 'consumption', 'search_default_not_restricted': 1}" />
42
<!-- domain="[('list_ids', '=', parent.sublist_id)]" /> -->
58
context="{'location': parent.cons_location_id, 'compute_child': False}"
59
domain="[('list_ids', '=', parent.sublist_id)]" />
43
60
<field name="uom_id"
44
on_change="uom_onchange(product_id, consumed_qty, parent.cons_location_id, uom_id, prodlot_id)"/>
61
on_change="uom_onchange(product_id, parent.cons_location_id, uom_id, prodlot_id)"/>
45
62
<field name="product_qty" />
46
63
<field name="prodlot_id"
47
on_change="change_prodlot(product_id, prodlot_id, expiry_date, parent.cons_location_id, uom_id, remark)"
64
on_change="change_prodlot(product_id, prodlot_id, expiry_date, parent.cons_location_id, uom_id)"
48
65
domain="[('product_id', '=', product_id), ('stock_available', '>', 0)]"
49
context="{'location_id': parent.cons_location_id, 'uom': uom_id, 'hidden_perishable_mandatory': not batch_mandatory}"
50
attrs="{'required': [('batch_mandatory', '=', True)], 'readonly': [('date_mandatory', '=', False), ('batch_mandatory', '=', False)]}" />
66
context="{'location_id': parent.cons_location_id, 'uom': uom_id, 'hidden_perishable_mandatory': date_mandatory}"
67
attrs="{'required': [('batch_mandatory', '=', True)], 'readonly': [('batch_mandatory', '=', False)]}" />
51
68
<field name="expiry_date"
52
on_change="change_expiry(expiry_date, product_id, parent.cons_location_id, uom_id, remark)"
53
attrs="{'required': [('date_mandatory', '=', True), ('batch_mandatory', '=', False)], 'readonly': ['|', ('batch_mandatory', '=', True), ('date_mandatory', '=', False)]}"/>
54
<field name="asset_id"
55
attrs="{'required': [('asset_mandatory', '=', True)], 'readonly': [('asset_mandatory', '=', False)]}"
56
on_change="change_asset(asset_id, product_id, parent.cons_location_id, uom_id, remark)"
57
domain="[('product_id', '=', product_id)]" />
69
on_change="change_expiry(expiry_date, product_id, parent.cons_location_id, uom_id)"
70
attrs="{'required': [('date_mandatory', '=', True)], 'readonly': [('date_mandatory', '=', False)]}"/>
58
71
<field name="consumed_qty" on_change="change_qty(consumed_qty, product_id, prodlot_id, parent.cons_location_id, uom_id)"/>
59
<field name="move_id" invisible="1" />
60
<button string="Duplicate line" icon="terp-stock_effects-object-colorize" name="copy" type="object" attrs="{'invisible': [('move_id', '!=', False)]}" />
61
<field name="remark" invisible="1" />
62
<field name="batch_mandatory" invisible="0" string="B.Num" readonly="1" />
63
<field name="date_mandatory" invisible="0" string="Exp" readonly="1" />
64
<field name="asset_mandatory" invisible="0" string="Asset" readonly="1" />
65
<field name="to_correct_ok" invisible="1"/>
66
<field name="text_error" invisible="context.get('hide_column_error_ok', False) != True" />
67
<field name="inactive_product" invisible="1" />
68
<field name="inactive_error" readonly="1" />
72
<field name="remark" />
73
<field name="batch_mandatory" invisible="1" />
74
<field name="date_mandatory" invisible="1" />
71
77
<field name="created_ok" invisible="1" />
72
<group colspan="4" col="6">
73
<button name="button_update_stock" string="Update Indicative Stock" icon="gtk-refresh" colspan="2" type="object" attrs="{'invisible': [('state','!=','draft')]}" />
74
<button name="cancel_button" string="Cancel" icon="gtk-cancel" type="object" colspan="2" attrs="{'invisible': [('state', '!=', 'draft')]}" />
75
<button name="process_moves" string="Save & Process" icon="gtk-execute" type="object" colspan="2" attrs="{'invisible': [('state','!=','draft')]}" />
76
<button name="draft_button" string="Draft" icon="gtk-apply" type="object" colspan="2" attrs="{'invisible': [('state', '!=', 'cancel')]}" />
79
<field name="state" />
78
<button name="button_update_stock" string="Update Indicative Stock" icon="gtk-refresh" colspan="2" type="object" attrs="{'invisible': [('created_ok', '=', True)]}" />
79
<button name="save_and_process" string="Save & Process" icon="gtk-execute" type="object" colspan="2" attrs="{'invisible': [('created_ok', '=', True)]}" />
85
84
<record id="real_average_consumption_confirmation_view" model="ir.ui.view">
86
85
<field name="name">real.average.consumption.confirmation.view</field>
87
86
<field name="model">real.average.consumption</field>
182
188
<form string="Monthly consumption">
183
189
<separator colspan="4" string="General information" />
184
190
<field name="period_from" on_change="period_change(period_from, period_to)" />
185
<!-- uf-1344 => we replace the import export of csv by import export of xml file (Excel compatibility). (see msf_doc_import) -->
186
191
<button name="import_fmc" string="Import a file" icon="gtk-leave-fullscreen" type="object" colspan="2" />
187
192
<field name="period_to" on_change="period_change(period_from, period_to)" />
188
<!-- uf-1344 => we replace the import export of csv by import export of xml file (Excel compatibility). (see msf_doc_import) -->
189
193
<button name="export_fmc" string="Export lines" icon="terp-mail-forward" type="object" colspan="2" />
190
194
<field name="cons_location_id" />
196
<field name="sublist_id" attrs="{'readonly': [('nomen_manda_0', '!=', False)]}"/>
197
<group colspan="2" col="4" attrs="{'readonly': [('sublist_id', '!=', False)]}">
198
<field name="nomen_manda_0"
199
domain="[('level', '=', '0'), ('type', '=', 'mandatory')]"
201
on_change="onChangeSearchNomenclature(0, 'mandatory', nomen_manda_0, nomen_manda_1, nomen_manda_2, nomen_manda_3, False)"
203
<field name="nomen_manda_1"
204
domain="[('id','=', 0)]"
206
get_selection="get_nomen"
207
on_change="onChangeSearchNomenclature(1, 'mandatory', nomen_manda_0, nomen_manda_1, nomen_manda_2, nomen_manda_3, False)"
209
<field name="nomen_manda_2"
210
domain="[('id','=', 0)]"
212
get_selection="get_nomen"
213
on_change="onChangeSearchNomenclature(2, 'mandatory', nomen_manda_0, nomen_manda_1, nomen_manda_2, nomen_manda_3, False)"
215
<field name="nomen_manda_3"
216
domain="[('id','=', 0)]"
218
get_selection="get_nomen"
219
on_change="onChangeSearchNomenclature(3, 'mandatory', nomen_manda_0, nomen_manda_1, nomen_manda_2, nomen_manda_3, False)"
222
<button colspan="4" icon="gtk-go-down" string="Fill lines" type="object" name="fill_lines" />
192
223
<separator colspan="4" string="Products" />
193
<group colspan="4" col="6" name="import" string="Import lines">
194
<button name="add_multiple_lines" string="Add multiple lines" type="object" icon="gtk-add" colspan="2" />
195
<button name="button_remove_lines" string="Delete Lines" icon="gtk-remove" colspan="2" type="object" />
197
<button name="button_remove_lines" string="Remove lines" icon="gtk-remove" type="object"
198
confirm="Are you sure that you want to remove all lines?" invisible="1"/>
199
<field name="hide_column_error_ok" invisible="1" />
200
<field colspan="4" name="line_ids" mode="tree" nolabel="1" widget="one2many_list"
201
context="{'hide_column_error_ok': hide_column_error_ok, 'active_id': active_id}">
202
<tree string="Products" editable="top" colors="red: to_correct_ok==True">
203
<field name="name" on_change="product_onchange(name, parent.id, parent.period_from, parent.period_to)" />
224
<field colspan="4" name="line_ids" mode="tree" nolabel="1" widget="one2many_list">
225
<tree string="Products" editable="top">
226
<field name="name" on_change="product_onchange(name, parent.id, parent.period_from, parent.period_to)"
227
domain="[('list_ids', '=', parent.sublist_id)]" />
204
228
<field name="amc" />
205
229
<field name="fmc" on_change="fmc_change(amc, fmc, name)" attrs="{'readonly': [('valid_ok', '=', True)]}" />
206
<field name="security_stock" />
207
230
<field name="last_reviewed" />
208
231
<field name="valid_ok" />
209
232
<field name="valid_until" />
210
<field name="fmc2" invisible="1" />
211
<field name="last_reviewed2" invisible="1" />
233
<field name="fmc2" invisible="1" />
234
<field name="last_reviewed2" invisible="1" />
235
<!--<button name="valid_line" type="object" string="Valid line" icon="gtk-execute" attrs="{'invisible': [('valid_ok', '=', True)]}" />-->
212
236
<button name="display_graph" type="object" string="Display graph" icon="terp-purchase" />
213
<field name="to_correct_ok" invisible="1"/>
214
<field name="text_error" invisible="context.get('hide_column_error_ok', False) != True" />
217
239
<button colspan="4" icon="gtk-execute" string="Valid all lines" type="object" name="valid_multiple_lines" />
322
<!-- REAL AVERAGE CONSUMPTION -->
324
id="report_real_consumption_xls"
325
string="Real Consumption Excel Export"
326
model="real.average.consumption"
327
name="real.consumption.xls"
328
file="consumption_calculation/report/report_real_consumption_xls.mako"
335
<!-- MONTHLY REVIEW CONSUMPTION -->
337
id="report_monthly_consumption_xls"
338
string="Monthly Consumption Excel Export"
339
model="monthly.review.consumption"
340
name="monthly.consumption.xls"
341
file="consumption_calculation/report/report_monthly_consumption_xls.mako"
348
<!-- INCOMING SHIPMENT CONSUMPTION EXPORT -->
350
id="report_incoming_consumption_xls"
352
model="stock.picking"
353
name="incoming.consumption.xls"
354
file="consumption_calculation/report/report_incoming_consumption_xls.mako"
362
<record id="action_incoming_print_xml_export" model="ir.actions.server">
363
<field name="name">XML Export</field>
364
<field name="model_id" ref="model_wizard_incoming_xml_export" />
365
<field name="state">code</field>
366
<field name="code">action = obj.print_report(context=context)</field>
369
<record id="ir_print_incoming_xml_export" model="ir.values">
370
<field name="key2">client_print_multi</field>
371
<field name="model">stock.picking</field>
372
<field name="name">XML Export</field>
373
<field eval="'ir.actions.server,%d'%action_incoming_print_xml_export" name="value" />
374
<field eval="True" name="object" />
377
<record id="view_real_consumption_change_location" model="ir.ui.view">
378
<field name="name">real.consumption.change.location.form.view</field>
379
<field name="model">real.consumption.change.location</field>
380
<field name="type">form</field>
381
<field name="arch" type="xml">
382
<form string="Change location">
383
<separator colspan="4" string="New location" />
384
<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" />
385
<label colspan="4" string=" "/>
386
<field name="location_id" required="1" domain="[('usage', '=', 'internal')]" />
387
<separator colspan="4" string="Actions" />
388
<label colspan="2"> </label>
389
<button special="cancel" string="Cancel" icon="gtk-cancel" />
390
<button name="change_location" string="Change location" type="object" icon="gtk-preferences" />