1
<?xml version="1.0" encoding="UTF-8"?>
5
<record id="view_kit_creation_form" model="ir.ui.view">
6
<field name="name">kit.creation.form</field>
7
<field name="model">kit.creation</field>
8
<field name="type">form</field>
9
<field name="arch" type="xml">
10
<form string="Kitting Order" hide_duplicate_button="True" hide_delete_button="True">
11
<group col="6" colspan="4">
12
<group col="4" colspan="4">
13
<field name="product_id_kit_creation" colspan="4" on_change="on_change_product_id(product_id_kit_creation)" attrs="{'readonly': [('state', '!=', 'draft')]}" />
14
<field name="qty_kit_creation" attrs="{'readonly': [('state', '!=', 'draft')]}" colspan="2" />
15
<field name="uom_id_kit_creation" attrs="{'readonly': [('state', '!=', 'draft')]}" colspan="2" string="UoM" domain="[('uom_by_product', '=', product_id_kit_creation)]"/>
17
<group col="4" colspan="2">
18
<field name="name" colspan="2" attrs="{'readonly': [('state', '!=', 'draft')]}" />
19
<field name="creation_date_kit_creation" colspan="2" attrs="{'readonly': [('state', '!=', 'draft')]}" />
20
<field name="batch_check_kit_creation" invisible="True" colspan="2" />
21
<field name="expiry_check_kit_creation" invisible="True" colspan="2" />
22
<field name="version_id_kit_creation"
23
domain="[('composition_product_id', '=', product_id_kit_creation), ('composition_type', '=', 'theoretical'), ('state', '=', 'completed')]"
24
attrs="{'readonly': [('state', '!=', 'draft')]}"
25
context="{'composition_type': 'theoretical'}"
28
<button name="do_reset_to_version" type="object" string="Display Items from Version" icon="gtk-sort-descending" colspan="2" attrs="{'invisible': [('state', '!=', 'draft')]}" />
31
<notebook colspan="4">
32
<page string="Components">
33
<field name="default_location_src_id_kit_creation" attrs="{'readonly': [('state', 'not in', ['draft', 'in_production'])]}" />
34
<field name="consider_child_locations_kit_creation" attrs="{'readonly': [('state', 'not in', ['draft', 'in_production'])]}" />
35
<field name="internal_picking_id_kit_creation" />
36
<field name="to_consume_ids_kit_creation" colspan="4" nolabel="True" context="{'location_src_id_to_consume': default_location_src_id_kit_creation}" attrs="{'readonly': [('state', 'not in', ['in_production'])]}">
37
<tree string="Components to Consume" hide_new_button="True" hide_delete_button="True" editable="top" colors="red:qty_available_to_consume < total_qty_to_consume;grey:consumed_to_consume">
38
<field name="line_number_to_consume" />
39
<field name="module_to_consume" />
40
<field name="product_id_to_consume"
41
on_change="on_change_product_id(product_id_to_consume, parent.default_location_src_id_kit_creation, parent.consider_child_locations_kit_creation, context)" />
42
<field name="qty_to_consume"
43
on_change="on_change_qty(qty_to_consume, parent.qty_kit_creation, context)" />
44
<field name="total_qty_to_consume" />
45
<field name="uom_id_to_consume"
46
on_change="on_change_uom_id(product_id_to_consume, parent.default_location_src_id_kit_creation, parent.consider_child_locations_kit_creation, uom_id_to_consume, location_src_id_to_consume, context)" />
47
<field name="location_src_id_to_consume"
48
attrs="{'readonly': ['|', ('consumed_to_consume', '=', True), ('fake_state', '!=', 'in_production')]}"
49
context="{'product_id':product_id_to_consume, 'specific_rules_tree_view':True, 'compute_child':parent.consider_child_locations_kit_creation}" />
50
<field name="qty_available_to_consume" />
51
<field name="availability_to_consume" invisible="True" />
52
<field name="fake_state" invisible="True" />
53
<field name="batch_check_kit_creation_to_consume" />
54
<field name="expiry_check_kit_creation_to_consume" />
55
<button name="do_process_to_consume" type="object" string="Process Line" icon="gtk-go-forward" attrs="{'invisible': ['|', ('consumed_to_consume', '=', True), ('fake_state', '!=', 'in_production')]}" />
56
<field name="consumed_to_consume" invisible="True" />
59
<group col="4" colspan="4">
61
<group col="4" colspan="2">
62
<button name="dummy_function" type="object" string="Update Available Qty" icon="gtk-refresh" attrs="{'invisible': [('state', 'not in', ['draft', 'in_production'])]}" />
63
<button name="start_production" type="object" string="Start Production" icon="gtk-dnd-multiple" attrs="{'invisible': [('state', '!=', 'draft')]}" />
64
<button name="do_process_to_consume2" type="object" string="Process All Lines" icon="gtk-go-forward" attrs="{'invisible': [('state', '!=', 'in_production')]}" />
67
<field name="consumed_ids_kit_creation" colspan="4" nolabel="True" mode="tree,form,graph" context="{'consumed': True}" attrs="{'readonly': [('state', '!=', 'in_production')]}">
68
<tree string="Consumed Components" editable="top" hide_new_button="True" hide_delete_button="True">
69
<field name="kit_creation_id_stock_move" invisible="True" />
70
<field name="line_number" invisible="True" />
71
<field name="product_id" readonly="True" />
72
<field name="product_qty" readonly="True" string="Qty" />
73
<field name="assigned_qty_stock_move" invisible="True" />
74
<field name="product_uom" readonly="True" string="UoM" />
75
<field name="hidden_asset_check" invisible="True" />
76
<field name="asset_id" domain="[('product_id', '=', product_id)]"
77
attrs="{'readonly': ['|', ('hidden_state', '!=', 'confirmed'), ('hidden_asset_check', '=', False)]}" />
78
<field name="prodlot_id"
79
context="{'location_id':location_id, 'product_id':product_id, 'hidden_perishable_mandatory': hidden_perishable_mandatory,
80
'search_default_real': True}"
81
on_change="kol_prodlot_change(prodlot_id)"
82
domain="[('product_id', '=', product_id),('check_type','=', True)]"
83
attrs="{'readonly': ['|', ('hidden_state', '!=', 'confirmed'), ('hidden_exp_check', '=', False)],
84
'required': [('hidden_exp_check', '=', True)]}" />
85
<field name="expired_date" />
86
<field name="location_id"
87
attrs="{'readonly': [('hidden_state', '!=', 'confirmed')]}"
88
context="{'product_id':product_id, 'prodlot_id': prodlot_id, 'specific_rules_tree_view':True, 'compute_child': False}"
89
domain="[('usage', '=', 'internal')]" />
90
<field name="state" />
91
<field name="lot_check" />
92
<field name="exp_check" />
93
<field name="kol_lot_manual" invisible="True" />
94
<field name="hidden_perishable_mandatory" invisible="True" />
95
<field name="hidden_exp_check" invisible="True" />
96
<field name="hidden_state" invisible="True" />
97
<field name="hidden_prodlot_id" invisible="True" />
98
<field name="hidden_creation_state" invisible="True" />
99
<field name="hidden_creation_qty_stock_move" invisible="True" />
100
<button name="split_stock_move" type="object" string="Split Move" icon="terp-stock_effects-object-colorize" attrs="{'invisible': [('hidden_state', 'not in', ['confirmed'])]}" />
101
<button name="force_assign" type="object" string="Force Availability" icon="gtk-jump-to" attrs="{'invisible': [('hidden_state', '!=', 'confirmed')]}" />
102
<button name="cancel_assign" type="object" string="Cancel Availability" icon="gtk-undo" attrs="{'invisible': [('hidden_state', '!=', 'assigned')]}" />
103
<button name="validate_assign" type="object" string="Validate" icon="gtk-go-forward" attrs="{'invisible': [('hidden_state', '!=', 'assigned')]}" />
104
<button name="assign_to_kit" type="object" string="Assign to Kits" icon="gtk-indent"
105
attrs="{'invisible': ['|', ('hidden_creation_state', '!=', 'in_production'), '|', ('hidden_prodlot_id', '=', False), '|', ('hidden_state', '!=', 'done'), ('hidden_creation_qty_stock_move', '=', 1)]}" />
106
<field name="original_from_process_stock_move" invisible="True" />
109
<group col="4" colspan="4">
110
<button name="cancel_all_lines" type="object" string="Cancel All Lines" icon="gtk-cancel" invisible="True" />
111
<button name="cancel_availability_all_lines" type="object" string="Cancel Availability" icon="gtk-undo" attrs="{'readonly': [('state', '!=', 'in_production')]}" invisible="True" />
112
<button name="force_assign2" type="object" string="Force Availability" icon="gtk-jump-to" attrs="{'readonly': [('state', '!=', 'in_production')]}" invisible="True" />
113
<button name="consolidate_lines" type="object" string="Reset 'Not Available' Lines" icon="gtk-clear" attrs="{'invisible': [('state', '!=', 'in_production')]}" />
114
<button name="check_availability" type="object" string="Check Availability" icon="gtk-execute" attrs="{'invisible': [('state', '!=', 'in_production')]}" />
115
<button name="validate_assign_all_lines" type="object" string="Validate all 'Available' Lines" icon="gtk-go-forward" attrs="{'invisible': [('state', '!=', 'in_production')]}" />
116
<button name="process_to_consume" type="object" string="Assign Automatically to Kits" icon="gtk-go-forward" readonly="True" invisible="True" />
120
<field name="location_dest_id_kit_creation" attrs="{'readonly': [('state', 'not in', ['draft', 'in_production'])]}" />
121
<group col="4" colspan="4">
122
<field name="kit_ids_kit_creation" nolabel="True" readonly="True" colspan="4" />
125
<page string="Notes">
126
<field name="notes_kit_creation" nolabel="True" />
129
<group col="5" colspan="2">
130
<field name="state" colspan="3" />
132
<group col="7" colspan="2">
133
<button name="action_cancel" type="object" string="Cancel" icon="gtk-cancel" attrs="{'invisible': [('state', 'in', ['done', 'cancel'])]}" />
134
<field name="completed_kit_creation" invisible="True" />
135
<button name="confirm_kitting" type="object" string="Confirm Kitting" icon="gtk-apply" attrs="{'invisible': ['|', ('completed_kit_creation', '=', False), ('state', '!=', 'in_production')]}" />
141
<record id="view_kit_creation_tree" model="ir.ui.view">
142
<field name="name">kit.creation.tree</field>
143
<field name="model">kit.creation</field>
144
<field name="type">tree</field>
145
<field name="arch" type="xml">
146
<tree string="Kitting Order" hide_delete_button="True">
147
<field name="name" />
148
<field name="product_id_kit_creation" />
149
<field name="version_id_kit_creation" />
150
<field name="qty_kit_creation" />
151
<field name="uom_id_kit_creation" />
152
<field name="creation_date_kit_creation" />
153
<field name="state" />
158
<record id="view_kit_creation_to_consume_tree" model="ir.ui.view">
159
<field name="name">kit.creation.to.consume.tree</field>
160
<field name="model">kit.creation.to.consume</field>
161
<field name="type">tree</field>
162
<field name="arch" type="xml">
163
<tree string="Components to Consume" hide_new_button="True" hide_delete_button="True" editable="top" colors="red:qty_available_to_consume < total_qty_to_consume;grey:consumed_to_consume">
164
<field name="line_number_to_consume" />
165
<field name="module_to_consume" />
166
<field name="product_id_to_consume"
167
on_change="on_change_product_id(product_id_to_consume, parent.default_location_src_id_kit_creation, parent.consider_child_locations_kit_creation, context)" />
168
<field name="qty_to_consume"
169
on_change="on_change_qty(qty_to_consume, parent.qty_kit_creation, context)" />
170
<field name="total_qty_to_consume" />
171
<field name="uom_id_to_consume"
172
on_change="on_change_uom_id(product_id_to_consume, parent.default_location_src_id_kit_creation, parent.consider_child_locations_kit_creation, uom_id_to_consume, location_src_id_to_consume, context)" />
173
<field name="location_src_id_to_consume"
174
attrs="{'readonly': ['|', ('consumed_to_consume', '=', True), ('fake_state', '!=', 'in_production')]}"
175
context="{'product_id':product_id_to_consume, 'specific_rules_tree_view':True, 'compute_child':parent.consider_child_locations_kit_creation}" />
176
<field name="qty_available_to_consume" />
177
<field name="availability_to_consume" invisible="True" />
178
<field name="fake_state" invisible="True" />
179
<field name="batch_check_kit_creation_to_consume" />
180
<field name="expiry_check_kit_creation_to_consume" />
181
<button name="do_process_to_consume" type="object" string="Process Line" icon="gtk-go-forward" attrs="{'invisible': ['|', ('consumed_to_consume', '=', True), ('fake_state', '!=', 'in_production')]}" />
182
<field name="consumed_to_consume" invisible="True" />
187
<record id="view_kit_creation_consumed_tree" model="ir.ui.view">
188
<field name="name">kit.creation.consumed.tree</field>
189
<field name="model">kit.creation.consumed</field>
190
<field name="type">tree</field>
191
<field name="arch" type="xml">
192
<tree string="Components Consumed" editable="top">
193
<field name="product_id_to_consume" />
194
<field name="qty_to_consume" />
195
<field name="uom_id_to_consume" />
196
<field name="lot_id_consumed" />
197
<field name="expiry_date_consumed" />
198
<field name="location_src_id_to_consume" />
199
<field name="kit_id_consumed" />
200
<field name="state" invisible="True" />
201
<field name="batch_check_kit_creation_to_consume" />
202
<field name="expiry_check_kit_creation_to_consume" />
207
<record id="view_kit_creation_filter" model="ir.ui.view">
208
<field name="name">kit.creation.filter</field>
209
<field name="model">kit.creation</field>
210
<field name="type">search</field>
211
<field name="arch" type="xml">
212
<search string="Search Kitting Order">
213
<filter icon="terp-document-new" name="draft" string="Draft" domain="[('state','=','draft')]" separator="1" />
214
<filter icon="gtk-execute" name="in_production" string="In Production" domain="[('state','=', 'in_production')]" separator="1" />
215
<filter icon="terp-dialog-close" name="done" string="Closed" domain="[('state','=','done')]" />
216
<filter icon="gtk-cancel" name="cancel" string="Canceled" domain="[('state','=', 'cancel')]" separator="1" />
217
<separator orientation="vertical" />
218
<field name="name" select="1" />
219
<field name="product_id_kit_creation" domain="[('type', '=', 'product'), ('subtype', '=', 'kit')]" select="1" />
220
<field name="version_id_kit_creation" select="1" context="{'wizard_composition_type': 'theoretical'}" domain="[('composition_type', '=', 'theoretical'), ('state', '=', 'completed')]" />
221
<field name="creation_date_kit_creation" />
223
<group expand="0" string="Group By..." colspan="4" col="10">
224
<filter string="Product" icon="terp-product" domain="[]" context="{'group_by':'product_id_kit_creation'}" />
225
<filter string="Version" icon="gtk-select-font" domain="[]" context="{'group_by':'version_id_kit_creation'}" />
226
<filter string="State" icon="gtk-execute" domain="[]" context="{'group_by':'state'}"/>
227
<separator orientation="vertical"/>
228
<filter string="Creation Date" icon="terp-go-month" domain="[]" context="{'group_by':'creation_date_kit_creation'}"/>
234
<record id="kit_creation_action" model="ir.actions.act_window">
235
<field name="name">Kitting Order</field>
236
<field name="res_model">kit.creation</field>
237
<field name="view_type">form</field>
238
<field name="view_mode">tree,form</field>
239
<field name="domain">[]</field>
240
<field name="context">{}</field>
241
<field name="search_view_id" ref="view_kit_creation_filter" />
244
<record id="kit_creation_action2" model="ir.actions.act_window">
245
<field name="name">Kitting Orders</field>
246
<field name="res_model">kit.creation</field>
247
<field name="view_type">form</field>
248
<field name="view_mode">tree,form</field>
249
<field name="domain">[('product_id_kit_creation', '=', active_id)]</field>
250
<field name="context">{}</field>
251
<field name="search_view_id" ref="view_kit_creation_filter" />
254
<record id="ir_open_composition_list_view" model="ir.values">
255
<field name="key2">client_action_relate</field>
256
<field name="model">product.product</field>
257
<field name="name">Kitting Orders</field>
258
<field eval="'ir.actions.act_window,%d'%ref('kit_creation_action2')" name="value"/>
259
<field name="key">action</field>
260
<field eval="True" name="object"/>
263
<menuitem action="kit_creation_action" id="kit_creation_menu" parent="kit_management" sequence="20" />