-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproduct_view.xml
executable file
·478 lines (432 loc) · 24 KB
/
product_view.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
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
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
<?xml version="1.0" ?>
<openerp>
<data>
<record id="product_variant" model="ir.actions.act_window">
<field name="name">Product Variants</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">product.product</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
<record id="product_template" model="ir.actions.act_window">
<field name="name">Product Templates</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">product.template</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem action="product_template" id="menu_template" parent="stock.menu_stock_product" />
<menuitem action="product_variant" id="menu_variant" parent="stock.menu_stock_product" />
<menuitem name="Variant dimensions" id="menu_variant_dimension" parent="stock.menu_product_in_config_stock" />
<!-- Views from Dimension option -->
<record id="product_variant_multi_dimension_option_tree" model="ir.ui.view">
<field name="name">product.variant.multi.dimension.option.tree</field>
<field name="model">product.variant.dimension.option</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Dimension Options">
<field name="dimension_id" invisible="not context.get('dimension_value_main_view', False)" />
<field name="name" />
<field name="sequence" />
<field name="code" />
</tree>
</field>
</record>
<record id="product_variant_multi_dimension_option_form" model="ir.ui.view">
<field name="name">product.variant.multi.dimension.option.form</field>
<field name="model">product.variant.dimension.option</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Dimension Options">
<field name="dimension_id" select="1" invisible="not context.get('dimension_option_main_view', False)" />
<newline />
<field name="sequence" />
<field name="name" select="1" />
<field name="code" />
</form>
</field>
</record>
<!-- Default action for Dimension option -->
<record id="action_dimension_option" model="ir.actions.act_window">
<field name="name">Dimension Options</field>
<field name="res_model">product.variant.dimension.option</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="context">{'dimension_option_main_view': True}</field>
</record>
<!-- Menu entry for Dimension values -->
<menuitem id="menu_variant_dimension_option" icon="STOCK_JUSTIFY_FILL" parent="menu_variant_dimension" action="action_dimension_option" />
<!-- Views from Dimension values -->
<record id="product_variant_multi_dimension_value_tree" model="ir.ui.view">
<field name="name">product.variant.multi.dimension.value.tree</field>
<field name="model">product.variant.dimension.value</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Dimension values" editable="top">
<field name="product_tmpl_id" select="1" invisible="not context.get('dimension_value_main_view', False)" />
<field name="active" />
<field name="dimension_id" on_change="onchange_dimension_type(dimension_id)" />
<field name="option_id" domain="[('dimension_id', '=', dimension_id)]" />
<field name="sequence" />
<field name="cost_price_extra" />
<field name="price_extra" />
</tree>
</field>
</record>
<record id="product_variant_multi_dimension_value_form" model="ir.ui.view">
<field name="name">product.variant.multi.dimension.value.form</field>
<field name="model">product.variant.dimension.value</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Dimension values">
<field name="product_tmpl_id" select="1" invisible="not context.get('dimension_value_main_view', False)" />
<field name="active" />
<field name="dimension_id" />
<newline />
<field name="option_id" select="1" />
<field name="sequence" />
<field name="cost_price_extra" select="2" />
<field name="price_extra" select="2" />
<field name="price_margin" select="2" />
</form>
</field>
</record>
<!-- Default action for Dimension values -->
<record id="action_dimension_value" model="ir.actions.act_window">
<field name="name">Dimension values</field>
<field name="res_model">product.variant.dimension.value</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="context">{'dimension_value_main_view': True}</field>
</record>
<!-- Views for Dimension types -->
<record id="product_variant_multi_dimension_type_tree" model="ir.ui.view">
<field name="name">product.variant.multi.dimension.type.tree</field>
<field name="model">product.variant.dimension.type</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Dimension Types">
<field name="name" />
<field name="description" />
<!--<field name="option_ids" />-->
</tree>
</field>
</record>
<record id="product_variant_multi_dimension_type_form" model="ir.ui.view">
<field name="name">product.variant.multi.dimension.type.form</field>
<field name="model">product.variant.dimension.type</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Dimension Types">
<field name="name" select="1" />
<field name="description" select="2" />
<field name="sequence" />
<field name="allow_custom_value" select="2" />
<field name="mandatory_dimension" select="2" />
<field name="show_in_tree" />
<field name="option_ids" nolabel="1" colspan="4" />
</form>
</field>
</record>
<!-- Default action for Dimension types -->
<record id="action_dimension_type" model="ir.actions.act_window">
<field name="name">Dimension types</field>
<field name="res_model">product.variant.dimension.type</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="context">{'dimension_type_main_view': True}</field>
</record>
<!-- Menu entry for dimension types -->
<menuitem id="menu_variant_dimension_types" icon="STOCK_JUSTIFY_FILL" parent="menu_variant_dimension" action="action_dimension_type" />
<!-- TODO remove useless view of product.template in the module product or fusion this view with the existing view in product, it's depend how the inheritage on this view will be managed by the other module-->
<!--TODO add a wizard to add the option-->
<!--<button name="add_some_option" string="Add " type="object" colspan="2"/>-->
<record id="product_template_search_form_view" model="ir.ui.view">
<field name="name">product.template.search.form</field>
<field name="model">product.template</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Product Template">
<field name="name"/>
<field name="type"/>
<newline/>
<group expand="0" string="Extended Filters..." groups="base.group_extended">
</group>
<newline/>
<group expand='0' string='Group by...' groups="base.group_extended">
<filter string='Category' icon="terp-stock_symbol-selection" domain="[]" context="{'group_by' : 'categ_id'}" />
</group>
</search>
</field>
</record>
<record id="product_variant_multi_product_template_form_view" model="ir.ui.view">
<field name="name">product.variant.multi.product.template.form</field>
<field name="model">product.template</field>
<field name="type">form</field>
<field name="inherit_id" ref="product.product_template_form_view" />
<field name="arch" type="xml">
<data>
<field name="name" position="after">
<field name="is_multi_variants"/>
<button type="object" name="to_excel" string="To xls" />
</field>
<xpath expr="//group[@name='delay']" position="before">
<field name="location_id_fast" />
<newline/>
</xpath>
<xpath expr="/form/notebook" position="inside">
<page string="Variants">
<group colspan="1" col="4" attrs="{'invisible':[('is_multi_variants','=',False)]}">
<field name="dimension_type_ids" nolabel="1" colspan="4" >
<tree string="Измерения">
<field name="name" />
<field name="sequence" />
<field name="mandatory_dimension" />
<field name="description" />
</tree>
</field>
<button name="add_all_option" string="Add All Option" type="object" colspan="2"/>
<field name="value_ids" nolabel="1" colspan="4" />
</group>
<group colspan="1" col="4" attrs="{'invisible':[('is_multi_variants','=',False)]}">
<field name="variant_model_name" colspan="4"/>
<field name="variant_model_name_separator" colspan="4"/>
<field name="code_generator" colspan="4"/>
<field name="variant_track_production" colspan="4"/>
<field name="variant_track_incoming" colspan="4"/>
<field name="variant_track_outgoing" colspan="4"/>
<!--<button name="button_generate_variants" string="Generate / Update variants ->" type="object" colspan="4"/>-->
<!--<button name="insert_data" string="Insert data" type="object" colspan="4"/>-->
</group>
<field name="variant_ids" string="Variants" nolabel="1" colspan="1">
<tree string="Variants">
<field name="code" />
<field name="product_name" />
<field name="variants" string="Dimension Values" />
</tree>
</field>
</page>
</xpath>
</data>
</field>
</record>
<!-- TODO remove useless view of product.product in the module product or move this correct view in product, it's depend how the heritage on this view will be managed by the other module -->
<record id="product_search_form_view_variants" model="ir.ui.view">
<field name="name">product.search.form.variants</field>
<field name="model">product.product</field>
<field name="type">search</field>
<field name="inherit_id" ref="product.product_search_form_view"/>
<field name="arch" type="xml">
<field name="categ_id" position="before">
<field name="product_tmpl_id" widget="selection" />
<field name="multi" />
</field>
</field>
</record>
<record id="product_variant_form_view" model="ir.ui.view">
<field name="name">product.variant.form</field>
<field name="model">product.product</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Product Variant">
<field name="name" select="1" attrs="{'required':[]}"/>
<field name="product_tmpl_id" select="1"/>
<field name="variants"/>
<field name="default_code"/>
<field name="active"/>
<newline />
<notebook colspan="4">
<page string="Dimensions">
<field name="dimension_value_ids" context="{'product_tmpl_id':product_tmpl_id}" nolabel="1"/>
</page>
<page string="Price">
<field name="list_price" string="Template Sale Price" readonly="1"/>
<field name="price_margin" select="1"/>
<field name="price_extra" select="1"/>
<field name="cost_price_extra"/>
</page>
<page string="Lots">
<field name="track_production" />
<field name="track_incoming" />
<field name="track_outgoing" />
</page>
</notebook>
</form>
</field>
</record>
<record id="product_variant_tree_view" model="ir.ui.view">
<field name="name">product.variant.tree</field>
<field name="model">product.product</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Product Variant">
<field name="default_code"/>
<field name="name"/>
<field name="product_tmpl_id"/>
<field name="variants"/>
<field name="price_extra"/>
<field name="cost_price_extra"/>
</tree>
</field>
</record>
<record id="action_variant_tree" model="ir.actions.act_window.view">
<field name="sequence" eval="10" />
<field name="view_mode">tree</field>
<field name="act_window_id" ref="product_variant" />
<field name="view_id" ref="product_variant_tree_view" />
</record>
<record id="action_variant_form" model="ir.actions.act_window.view">
<field name="sequence" eval="20" />
<field name="view_mode">form</field>
<field name="act_window_id" ref="product_variant" />
<field name="view_id" ref="product_variant_form_view" />
</record>
<record id="product_normal_variant_form_view" model="ir.ui.view">
<field name="name">product.normal.variant.form</field>
<field name="model">product.product</field>
<field name="type">form</field>
<field name="inherit_id" ref="product.product_normal_form_view" />
<field name="arch" type="xml">
<data>
<!--
<field name="property_stock_inventory" position="after">
<field name="location_id_fast" />
</field>
-->
<field name="name" position="attributes">
<attribute name="required">1</attribute>
</field>
<field name="name" position="after">
<field name="product_name" />
<field name="parameters_values" readonly="1" />
</field>
<field name="standard_price" position="replace">
<group name='cost_prices' colspan="2" col="4">
<field name="standard_price" attrs="{'readonly':[('cost_method','=','average')]}"/>
<field name="cost_price_extra" groups="product.group_product_variant"/>
</group>
</field>
<group col="2" colspan="2" groups="base.group_extended" position="replace">
<group colspan="2" col="6" name="weight" groups="base.group_extended">
<field name="is_multi_variants" invisible="1"/>
<group colspan="2" col="2">
<separator string="Template Weights" colspan="2"/>
<field digits="(14, 3)" name="volume" attrs="{'readonly':[('type','=','service')]}"/>
<field digits="(14, 3)" name="weight" attrs="{'readonly':[('type','=','service')]}"/>
<field digits="(14, 3)" name="weight_net" attrs="{'readonly':[('type','=','service')]}"/>
</group>
<group colspan="2" col="2" attrs="{'invisible':[('is_multi_variants','=',False)]}">
<separator string="Variant Weights" colspan="2"/>
<field digits="(14, 3)" name="additional_volume" attrs="{'readonly':[('type','=','service')]}"/>
<field digits="(14, 3)" name="additional_weight" attrs="{'readonly':[('type','=','service')]}"/>
<field digits="(14, 3)" name="additional_weight_net" attrs="{'readonly':[('type','=','service')]}"/>
</group>
<group colspan="2" col="2" attrs="{'invisible':[('is_multi_variants','=',False)]}">
<separator string="Total Weights" colspan="2"/>
<field digits="(14, 3)" name="total_volume"/>
<field digits="(14, 3)" name="total_weight"/>
<field digits="(14, 3)" name="total_weight_net"/>
</group>
<!--
<group colspan="2" col="2" attrs="{'invisible':[('is_multi_variants','=',False)]}">
<field name="register_uom" />
<field name="register_uom_rule" />
<field name="register_uom_rel" />
<field name="register_uom_qty" />
</group>-->
</group>
</group>
</data>
</field>
</record>
<record id="product_template_form_view_uom" model="ir.ui.view">
<field name="name">product.template.form.view.uom</field>
<field name="model">product.template</field>
<field name="type">form</field>
<field name="inherit_id" ref="product.product_template_form_view" />
<field name="arch" type="xml">
<data>
<field name="uom_po_id" position="after">
<field name="register_uom" />
<field name="register_uom_rule" />
</field>
</data>
</field>
</record>
<record id="product_variant_tree_view" model="ir.ui.view">
<field name="name">product.variant.tree.view</field>
<field name="model">product.product</field>
<field name="type">tree</field>
<field name="inherit_id" ref="product.product_product_tree_view" />
<field name="arch" type="xml">
<data>
<field name="name" position="after">
<field name="params" />
</field>
<field name="virtual_available" position="after">
<field name="register_uom" />
<field name="register_uom_qty" />
<field name="register_uom_virtual" />
</field>
</data>
</field>
</record>
<record id="make_product" model="ir.actions.act_window">
<field name="name">Make product from template</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">create.product</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="target">new</field>
</record>
<record id="product_template_tree_view_multi" model="ir.ui.view">
<field name="name">product.template.product.tree.multi</field>
<field name="model">product.template</field>
<field name="type">tree</field>
<field name="inherit_id" ref="product.product_template_tree_view" />
<field name="arch" type="xml">
<field name="state" position="after">
<button name="%(make_product)d"
string="Make product" groups="base.group_extended" icon="terp-stock_effects-object-colorize" type="action"
context="{}"
/>
</field>
</field>
</record>
<act_window name="Products"
domain="[('product_tmpl_id', '=', active_id)]"
context="{'product_tmpl_id': active_id}"
res_model="product.product"
src_model="product.template"
id="act_product_variant_multi_product_products"/>
<record id="product_normal_variant_form_view_multi" model="ir.ui.view">
<field name="name">product.normal.variant.form.multi</field>
<field name="model">product.product</field>
<field name="type">form</field>
<field name="inherit_id" ref="product.product_normal_form_view" />
<field name="arch" type="xml">
<data>
<field name="uom_po_id" position="after">
<field name="register_uom" />
<field name="register_uom_rule" />
<field name="register_uom_rel" />
<field name="register_uom_qty" />
</field>
</data>
</field>
</record>
<record id="product_normal_variant_form_view_ext" model="ir.ui.view">
<field name="name">product.normal.variant.form.ext</field>
<field name="model">product.product</field>
<field name="type">form</field>
<field name="inherit_id" ref="stock.view_normal_property_form" />
<field name="arch" type="xml">
<data>
<field name="property_stock_procurement" position="before">
<field name="location_id_fast" />
</field>
</data>
</field>
</record>
</data>
</openerp>