summaryrefslogtreecommitdiff
path: root/addons/product/views/product_views.xml
blob: 1538b92fb62e3f3253d684da56174b29c47c379d (plain)
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
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <data>
    <!-- base structure of product.template, common with product.product -->
    <record id="product_template_form_view" model="ir.ui.view">
        <field name="name">product.template.common.form</field>
        <field name="model">product.template</field>
        <field name="mode">primary</field>
        <field name="arch" type="xml">
            <form string="Product">
                <header>
                    <button string="Configure Variants" type="action"
                        name="%(product_attribute_value_action)d"
                        attrs="{'invisible': ['|', ('attribute_line_ids', '&lt;=', 0), ('is_product_variant', '=', True)]}"
                        groups="product.group_product_variant"/>
                </header>
                <sheet>
                    <field name='product_variant_count' invisible='1'/>
                    <field name='is_product_variant' invisible='1'/>
                    <field name='attribute_line_ids' invisible='1'/>
                    <div class="oe_button_box" name="button_box"/>
                    <widget name="web_ribbon" title="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/>
                    <field name="id" invisible="True"/>
                    <field name="image_1920" widget="image" class="oe_avatar" options="{'preview_image': 'image_128'}"/>
                    <div class="oe_title">
                        <label class="oe_edit_only" for="name" string="Product Name"/>
                        <h1><field name="name" placeholder="Product Name"/></h1>
                        <div name="options" groups="base.group_user">
                            <div>
                                <field name="sale_ok"/>
                                <label for="sale_ok"/>
                            </div>
                            <div>
                                <field name="purchase_ok"/>
                                <label for="purchase_ok"/>
                            </div>
                        </div>
                    </div>
                    <notebook>
                        <page string="General Information" name="general_information">
                            <group>
                                <group name="group_general">
                                    <field name="active" invisible="1"/>
                                    <field name="type"/>
                                    <field name="categ_id" string="Product Category"/>
                                </group>
                                <group name="group_standard_price">
                                    <label for="list_price"/>
                                    <div name="pricing">
                                      <field name="list_price" class="oe_inline" widget='monetary'
                                        options="{'currency_field': 'currency_id', 'field_digits': True}"/>
                                      <button name="open_pricelist_rules" icon="fa-arrow-right" type="object"
                                        groups="product.group_product_pricelist" class="oe_inline">
                                        <field name="pricelist_item_count" attrs="{'invisible': [('pricelist_item_count', '=', 0)]}"/>
                                        <span attrs="{'invisible': [('pricelist_item_count', '=', 1)]}">
                                          Extra Prices
                                        </span>
                                        <span attrs="{'invisible': [('pricelist_item_count', '!=', 1)]}">
                                          Extra Price
                                        </span>
                                      </button>
                                    </div>
                                    <label for="standard_price" groups="base.group_user" attrs="{'invisible': [('product_variant_count', '&gt;', 1), ('is_product_variant', '=', False)]}"/>
                                    <div name="standard_price_uom" groups="base.group_user" attrs="{'invisible': [('product_variant_count', '&gt;', 1), ('is_product_variant', '=', False)]}" class="o_row">
                                        <field name="standard_price" widget='monetary' options="{'currency_field': 'cost_currency_id', 'field_digits': True}"/>
                                        <span groups="uom.group_uom" class="oe_read_only">per
                                            <field name="uom_name"/>
                                        </span>
                                    </div>
                                    <field name="company_id" groups="base.group_multi_company"
                                        options="{'no_create': True}"/>
                                    <field name="uom_id" groups="uom.group_uom" options="{'no_create': True}"/>
                                    <field name="uom_po_id" groups="uom.group_uom" options="{'no_create': True}"/>
                                    <field name="currency_id" invisible="1"/>
                                    <field name="cost_currency_id" invisible="1"/>
                                    <field name="product_variant_id" invisible="1"/>
                                </group>
                            </group>
                            <group string="Internal Notes">
                                <field name="description" nolabel="1" placeholder="This note is only for internal purposes."/>
                            </group>
                        </page>
                        <page string="Sales" attrs="{'invisible':[('sale_ok','=',False)]}" name="sales" invisible="1">
                            <group name="sale">
                            </group>
                            <group string="Sales Description" name="description">
                                <field name="description_sale" nolabel="1" placeholder="This note is added to sales orders and invoices."/>
                            </group>
                        </page>
                        <page string="Purchase" name="purchase" attrs="{'invisible': [('purchase_ok','=',False)]}" invisible="1">
                            <group name="purchase">
                                <group string="Vendor Bills" name="bill"/>
                            </group>
                        </page>
                        <page string="Inventory" name="inventory" groups="product.group_stock_packaging" attrs="{'invisible':[('type', '=', 'service')]}">
                            <group name="inventory">
                                <group name="group_lots_and_weight" string="Logistics" attrs="{'invisible': [('type', 'not in', ['product', 'consu'])]}">
                                    <label for="weight" attrs="{'invisible':[('product_variant_count', '>', 1), ('is_product_variant', '=', False)]}"/>
                                    <div class="o_row" name="weight" attrs="{'invisible':[('product_variant_count', '>', 1), ('is_product_variant', '=', False)]}">
                                        <field name="weight"/>
                                        <span><field name="weight_uom_name"/></span>
                                    </div>
                                    <label for="volume" attrs="{'invisible':[('product_variant_count', '>', 1), ('is_product_variant', '=', False)]}"/>
                                    <div class="o_row" name="volume" attrs="{'invisible':[('product_variant_count', '>', 1), ('is_product_variant', '=', False)]}">
                                        <field name="volume" string="Volume"/>
                                        <span><field name="volume_uom_name"/></span>
                                    </div>
                                </group>
                            </group>
                            <group name="packaging" string="Packaging"
                                colspan="4"
                                attrs="{'invisible':['|', ('type', 'not in', ['product', 'consu']), ('product_variant_count', '>', 1), ('is_product_variant', '=', False)]}"
                                groups="product.group_stock_packaging">
                                <field name="packaging_ids" nolabel="1" context="{'tree_view_ref':'product.product_packaging_tree_view2', 'form_view_ref':'product.product_packaging_form_view2'}"/>
                            </group>
                        </page>
                    </notebook>
                </sheet>
                <div class="oe_chatter">
                    <field name="message_follower_ids"/>
                    <field name="activity_ids"/>
                    <field name="message_ids"/>
                </div>
            </form>
        </field>
    </record>

    <record id="product_template_search_view" model="ir.ui.view">
        <field name="name">product.template.search</field>
        <field name="model">product.template</field>
        <field name="arch" type="xml">
            <search string="Product">
                <field name="name" string="Product" filter_domain="['|', '|', '|', ('default_code', 'ilike', self), ('product_variant_ids.default_code', 'ilike', self),('name', 'ilike', self), ('barcode', 'ilike', self)]"/>
                <field name="categ_id" filter_domain="[('categ_id', 'child_of', raw_value)]"/>
                <separator/>
                <filter string="Services" name="services" domain="[('type','=','service')]"/>
                <filter string="Products" name="consumable" domain="[('type', 'in', ['consu', 'product'])]"/>
                <separator/>
                <filter string="Can be Sold" name="filter_to_sell" domain="[('sale_ok','=',True)]"/>
                <filter string="Can be Purchased" name="filter_to_purchase" domain="[('purchase_ok', '=', True)]"/>
                <separator/>
                <field string="Attributes" name="attribute_line_ids" groups="product.group_product_variant"/>
                <field name="pricelist_id" context="{'pricelist': self}" filter_domain="[]" groups="product.group_product_pricelist"/>
                <filter invisible="1" string="Late Activities" name="activities_overdue"
                    domain="[('my_activity_date_deadline', '&lt;', context_today().strftime('%Y-%m-%d'))]"
                    help="Show all records which has next action date is before today"/>
                <filter invisible="1" string="Today Activities" name="activities_today"
                    domain="[('my_activity_date_deadline', '=', context_today().strftime('%Y-%m-%d'))]"/>
                <filter invisible="1" string="Future Activities" name="activities_upcoming_all"
                    domain="[('my_activity_date_deadline', '&gt;', context_today().strftime('%Y-%m-%d'))
                    ]"/>
                <separator/>
                <filter string="Warnings" name="activities_exception"
                        domain="[('activity_exception_decoration', '!=', False)]"/>
                <separator/>
                <filter string="Archived" name="inactive" domain="[('active','=',False)]"/>
                <group expand="1" string="Group By">
                    <filter string="Product Type" name="type" context="{'group_by':'type'}"/>
                    <filter string="Product Category" name="categ_id" context="{'group_by':'categ_id'}"/>
                </group>
            </search>
        </field>
    </record>

    <record id="product_template_action_all" model="ir.actions.act_window">
        <field name="name">Products</field>
        <field name="type">ir.actions.act_window</field>
        <field name="res_model">product.template</field>
        <field name="view_mode">kanban,tree,form</field>
        <field name="context">{}</field>
        <field name="help" type="html">
            <p class="o_view_nocontent_smiling_face">
                Create a new product
            </p>
        </field>
    </record>

        <record id="product_search_form_view" model="ir.ui.view">
            <field name="name">product.product.search</field>
            <field name="model">product.product</field>
            <field name="mode">primary</field>
            <field name="inherit_id" ref="product.product_template_search_view"/>
            <field name="arch" type="xml">
                <field name="name" position="replace">
                    <field name="name" string="Product" filter_domain="['|', '|', ('default_code', 'ilike', self), ('name', 'ilike', self), ('barcode', 'ilike', self)]"/>
                </field>
                <field name="attribute_line_ids" position="replace">
                    <field name="product_template_attribute_value_ids" groups="product.group_product_variant"/>
                    <field name="product_tmpl_id" string="Product Template"/>
                </field>
            </field>
        </record>

        <record id="product_normal_action" 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_mode">tree,form,kanban,activity</field>
            <field name="search_view_id" ref="product_search_form_view"/>
            <field name="view_id" eval="False"/> <!-- Force empty -->
            <field name="help" type="html">
              <p class="o_view_nocontent_smiling_face">
                Create a new product variant
              </p><p>
                You must define a product for everything you sell or purchase,
                whether it's a storable product, a consumable or a service.
              </p>
            </field>
        </record>

        <record id="product_variant_easy_edit_view" model="ir.ui.view">
            <field name="name">product.product.view.form.easy</field>
            <field name="model">product.product</field>
            <field name="mode">primary</field>
            <field name="arch" type="xml">
                <form string="Variant Information" duplicate="false">
                    <sheet>
                        <div class="oe_button_box" name="button_box"/>
                        <widget name="web_ribbon" title="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/>
                        <field name="active" invisible="1"/>
                        <field name="id" invisible="1"/>
                        <field name="image_1920" widget="image" class="oe_avatar" options="{'preview_image': 'image_128'}"/>
                        <div class="oe_title">
                            <label class="oe_edit_only" for="name" string="Product Name"/>
                            <h1><field name="name" readonly="1" placeholder="e.g. Odoo Enterprise Subscription"/></h1>
                            <field name="product_template_attribute_value_ids" widget="many2many_tags" readonly="1"/>
                            <p>
                                <span>All general settings about this product are managed on</span>
                                <button name="open_product_template" type="object" string="the product template." class="oe_link oe_link_product pl-0 ml-1 mb-1"/>
                            </p>
                        </div>
                        <group>
                            <group name="codes" string="Codes">
                                <field name="default_code"/>
                                <field name="barcode"/>
                                <field name="type" invisible="1"/>
                                <field name="accurate_item_code"/>
                            </group>
                            <group name="pricing" string="Pricing">
                                <field name="product_variant_count" invisible="1"/>
                                <label for="lst_price"/>
                                <div class="o_row col-5 pl-0">
                                    <field name="lst_price" widget='monetary' options="{'currency_field': 'currency_id', 'field_digits': True}" attrs="{'readonly': [('product_variant_count', '&gt;', 1)]}"/>
                                </div>
                                <field name="standard_price" widget='monetary' options="{'currency_field': 'cost_currency_id'}"/>
                                <field name="currency_id" invisible='1'/>
                                <field name="cost_currency_id" invisible="1"/>
                            </group>
                        </group>
                        <group>
                            <group name="weight" string="Logistics" attrs="{'invisible':[('type', 'not in', ['product', 'consu'])]}">
                                <label for="volume"/>
                                <div class="o_row">
                                    <field name="volume"/>
                                    <span><field name="volume_uom_name"/></span>
                                </div>
                                <label for="weight"/>
                                <div class="o_row">
                                    <field name="weight"/>
                                    <span><field name="weight_uom_name"/></span>
                                </div>
                            </group>
                            <group name="packaging" string="Packaging" groups="product.group_stock_packaging">
                                <field name="packaging_ids" nolabel="1"
                                    context="{'tree_view_ref':'product.product_packaging_tree_view2', 'form_view_ref':'product.product_packaging_form_view2'}"/>
                            </group>
                        </group>
                    </sheet>
                </form>
            </field>
        </record>

        <record id="product_variant_action" 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="context">{'search_default_product_tmpl_id': [active_id], 'default_product_tmpl_id': active_id, 'create': False}</field>
            <field name="search_view_id" ref="product_search_form_view"/>
            <field name="view_ids"
                   eval="[(5, 0, 0),
                          (0, 0, {'view_mode': 'tree'}),
                          (0, 0, {'view_mode': 'form', 'view_id': ref('product_variant_easy_edit_view')}),
                          (0, 0, {'view_mode': 'kanban'})]"/>
             <field name="help" type="html">
              <p class="o_view_nocontent_smiling_face">
                Create a new product variant
              </p><p>
                You must define a product for everything you sell or purchase,
                whether it's a storable product, a consumable or a service.
                The product form contains information to simplify the sale process:
                price, notes in the quotation, accounting data, procurement methods, etc.
              </p>
            </field>
        </record>

        <record id="product_product_tree_view" model="ir.ui.view">
            <field name="name">product.product.tree</field>
            <field name="model">product.product</field>
            <field eval="7" name="priority"/>
            <field name="arch" type="xml">
                <tree string="Product Variants" multi_edit="1" duplicate="false" sample="1">
                    <field name="default_code" optional="show" readonly="1"/>
                    <field name="barcode" optional="hide" readonly="1"/>
                    <field name="name" readonly="1"/>
                    <field name="product_template_attribute_value_ids" widget="many2many_tags" groups="product.group_product_variant" readonly="1"/>
                    <field name="company_id" groups="base.group_multi_company" optional="hide" readonly="1"/>
                    <field name="lst_price" optional="show" string="Sales Price"/>
                    <field name="standard_price" optional="show"/>
                    <field name="categ_id" optional="hide"/>
                    <field name="type" optional="hide" readonly="1"/>
                    <field name="price" invisible="not context.get('pricelist',False)"/>
                    <field name="uom_id" options="{'no_open': True, 'no_create': True}" groups="uom.group_uom" optional="show" readonly="1"/>
                    <field name="product_tmpl_id" invisible="1" readonly="1"/>
                    <field name="active" invisible="1"/>
                </tree>
            </field>
        </record>

        <record id="product_normal_form_view" model="ir.ui.view">
            <field name="name">product.product.form</field>
            <field name="model">product.product</field>
            <field name="mode">primary</field>
            <field eval="7" name="priority"/>
            <field name="inherit_id" ref="product.product_template_form_view"/>
            <field name="arch" type="xml">
                <form position="attributes">
                    <attribute name="string">Product Variant</attribute>
                    <attribute name="duplicate">false</attribute>
                </form>
                <field name="type" position="after">
                    <field name="default_code"/>
                    <field name="barcode"/>
                </field>
                <field name="list_price" position="attributes">
                   <attribute name="name">lst_price</attribute>
                   <attribute name="attrs">{'readonly': [('product_variant_count', '&gt;', 1)]}</attribute>
                </field>
                <xpath expr="//label[@for='list_price']" position="replace">
                    <label for="lst_price"/>
                </xpath>
                <group name="packaging" position="attributes">
                    <attribute name="attrs">{'invisible': 0}</attribute>
                </group>
                <field name="name" position="after">
                    <field name="product_tmpl_id" class="oe_inline" readonly="1" invisible="1" attrs="{'required': [('id', '!=', False)]}"/>
                </field>
                <xpath expr="//div[hasclass('oe_title')]" position="inside">
                    <field name="product_template_attribute_value_ids" widget="many2many_tags" readonly="1"
                        groups="product.group_product_variant"/>
                </xpath>
            </field>
        </record>

        <record id="product_kanban_view" model="ir.ui.view">
            <field name="name">Product Kanban</field>
            <field name="model">product.product</field>
            <field name="arch" type="xml">
                <kanban sample="1">
                    <field name="id"/>
                    <field name="lst_price"/>
                    <field name="activity_state"/>
                    <progressbar field="activity_state" colors='{"planned": "success", "today": "warning", "overdue": "danger"}'/>
                    <templates>
                        <t t-name="kanban-box">
                            <div class="oe_kanban_global_click">
                                <div class="o_kanban_image">
                                    <img t-att-src="kanban_image('product.product', 'image_128', record.id.raw_value)" alt="Product" class="o_image_64_contain"/>
                                </div>
                                <div class="oe_kanban_details">
                                    <strong class="o_kanban_record_title">
                                        <field name="name"/>
                                        <small t-if="record.default_code.value">[<field name="default_code"/>]</small>
                                    </strong>
                                    <div class="o_kanban_tags_section">
                                        <field name="product_template_attribute_value_ids" groups="product.group_product_variant"/>
                                    </div>
                                    <ul>
                                        <li><strong>Price: <field name="lst_price"></field></strong></li>
                                    </ul>
                                    <div name="tags"/>
                                </div>
                            </div>
                        </t>
                    </templates>
                </kanban>
            </field>
        </record>

        <record id="product_product_view_activity" model="ir.ui.view">
            <field name="name">product.product.activity</field>
            <field name="model">product.product</field>
            <field name="arch" type="xml">
                <activity string="Product Variants">
                    <field name="id"/>
                    <field name="default_code"/>
                    <templates>
                        <div t-name="activity-box">
                            <img t-att-src="activity_image('product.product', 'image_128', record.id.raw_value)" role="img" t-att-title="record.id.value" t-att-alt="record.id.value"/>
                            <div>
                                <field name="name" display="full"/>
                                <div t-if="record.default_code.value" class="text-muted">
                                    [<field name="default_code"/>]
                                </div>
                            </div>
                        </div>
                    </templates>
                </activity>
            </field>
        </record>

        <record id="product_normal_action_sell" 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_mode">kanban,tree,form,activity</field>
            <field name="context">{"search_default_filter_to_sell":1}</field>
            <field name="view_id" ref="product_product_tree_view"/>
            <field name="search_view_id" ref="product_search_form_view"/>
            <field name="help" type="html">
              <p class="o_view_nocontent_smiling_face">
                Create a new product variant
              </p><p>
                You must define a product for everything you sell, whether it's a physical product,
                a consumable or a service you offer to customers.
                The product form contains information to simplify the sale process:
                price, notes in the quotation, accounting data, procurement methods, etc.
              </p>
            </field>
        </record>

        <record id="product_category_search_view" model="ir.ui.view">
            <field name="name">product.category.search</field>
            <field name="model">product.category</field>
            <field name="arch" type="xml">
                <search string="Product Categories">
                    <field name="name" string="Product Categories"/>
                    <field name="parent_id"/>
                </search>
            </field>
        </record>
        <record id="product_category_form_view" model="ir.ui.view">
            <field name="name">product.category.form</field>
            <field name="model">product.category</field>
            <field name="arch" type="xml">
                <form class="oe_form_configuration">
                    <sheet>
                        <div class="oe_button_box" name="button_box">
                            <button class="oe_stat_button"
                                name="%(product_template_action_all)d"
                                icon="fa-th-list"
                                type="action"
                                context="{'search_default_categ_id': active_id, 'default_categ_id': active_id, 'group_expand': True}">
                                <div class="o_field_widget o_stat_info">
                                    <span class="o_stat_value"><field name="product_count"/></span>
                                    <span class="o_stat_text"> Products</span>
                                </div>
                            </button>
                        </div>
                        <div class="oe_title">
                            <label for="name" string="Category name" class="oe_edit_only"/>
                            <h1><field name="name" placeholder="e.g. Lamps"/></h1>
                        </div>
                        <group name="first" col="2">
                            <field name="parent_id" class="oe_inline"/>
                        </group>
                    </sheet>
                </form>
            </field>
        </record>
        <record id="product_category_list_view" model="ir.ui.view">
            <field name="name">product.category.list</field>
            <field name="model">product.category</field>
            <field name="priority">1</field>
            <field name="arch" type="xml">
                <tree string="Product Categories">
                    <field name="display_name" string="Product Category"/>
                </tree>
            </field>
        </record>
        <record id="product_category_action_form" model="ir.actions.act_window">
            <field name="name">Product Categories</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">product.category</field>
            <field name="search_view_id" ref="product_category_search_view"/>
            <field name="view_id" ref="product_category_list_view"/>
        </record>


        <record id="product_packaging_tree_view" model="ir.ui.view">
            <field name="name">product.packaging.tree.view</field>
            <field name="model">product.packaging</field>
            <field name="arch" type="xml">
                <tree string="Product Packagings">
                    <field name="sequence" widget="handle"/>
                    <field name="product_id"/>
                    <field name="name" string="Packaging"/>
                    <field name="qty"/>
                    <field name="product_uom_id" options="{'no_open': True, 'no_create': True}" groups="uom.group_uom"/>
                    <field name="company_id" groups="base.group_multi_company"/>
                </tree>
            </field>
        </record>

        <record id="product_packaging_tree_view2" model="ir.ui.view">
            <field name="name">product.packaging.tree.view2</field>
            <field name="model">product.packaging</field>
            <field name="mode">primary</field>
            <field name="inherit_id" ref="product.product_packaging_tree_view"/>
            <field name="arch" type="xml">
                <xpath expr="//field[@name='product_id']" position="replace"/>
                <xpath expr="//field[@name='sequence']" position="replace"/>
            </field>
        </record>

        <record id="product_packaging_form_view" model="ir.ui.view">
            <field name="name">product.packaging.form.view</field>
            <field name="model">product.packaging</field>
            <field name="arch" type="xml">
                <form string="Product Packaging">
                    <sheet>
                        <label for="name" string="Packaging"/>
                        <h1>
                            <field name="name"/>
                        </h1>
                        <group>
                            <field name="id" invisible='1'/>
                            <group name="group_product">
                                <field name="product_id"  required='True' attrs="{'readonly': [('id', '!=', False)]}"/>
                            </group>
                            <group name="qty">
                                <label for="qty" string="Contained quantity"/>
                                <div class="o_row">
                                    <field name="qty"/>
                                    <field name="product_uom_id" options="{'no_open': True, 'no_create': True}" groups="uom.group_uom"/>
                                </div>
                                <field name="barcode"/>
                                <field name="company_id" groups="base.group_multi_company"/>
                            </group>
                        </group>
                    </sheet>
                </form>
            </field>
        </record>

        <record id="product_packaging_form_view2" model="ir.ui.view">
            <field name="name">product.packaging.form.view2</field>
            <field name="model">product.packaging</field>
            <field name="mode">primary</field>
            <field name="inherit_id" ref="product.product_packaging_form_view"/>
            <field name="arch" type="xml">
                <xpath expr="//group[@name='group_product']" position="replace"/>
                <xpath expr="//field[@name='id']" position="replace"/>
            </field>
        </record>

        <record model="ir.actions.act_window" id="action_packaging_view">
            <field name="name">Product Packagings</field>
            <field name="res_model">product.packaging</field>
            <field name="domain">[('product_id', '!=', False)]</field>
            <field name="view_ids" eval="[(5, 0, 0),
                (0, 0, {'view_mode': 'tree', 'view_id': ref('product_packaging_tree_view')}),
                (0, 0, {'view_mode': 'form', 'view_id': ref('product_packaging_form_view')})]"/>
        </record>

        <record id="product_supplierinfo_form_view" model="ir.ui.view">
            <field name="name">product.supplierinfo.form.view</field>
            <field name="model">product.supplierinfo</field>
            <field name="arch" type="xml">
                <form string="Vendor Information">
                    <sheet>
                        <group>
                            <group name="vendor" string="Vendor">
                                <field name="product_variant_count" invisible="1"/>
                                <field name="name" context="{'res_partner_search_mode': 'supplier'}"/>
                                <field name="product_name"/>
                                <field name="product_code"/>
                                <label for="delay"/>
                                <div>
                                    <field name="delay" class="oe_inline"/> days
                                </div>
                            </group>
                            <group string="Pricelist">
                                <field name="product_tmpl_id" string="Product" invisible="context.get('visible_product_tmpl_id', True)"/>
                                <field name="product_id" groups="product.group_product_variant" domain="[('product_tmpl_id', '=', product_tmpl_id)]" options="{'no_create_edit': True}"/>
                                <label for="min_qty"/>
                                <div class="o_row">
                                    <field name="min_qty"/>
                                    <field name="product_uom" groups="uom.group_uom"/>
                                </div>
                                <label for="price" string="Unit Price"/>
                                <div class="o_row">
                                    <field name="price"/><field name="currency_id" groups="base.group_multi_currency"/>
                                </div>
                                <label for="date_start" string="Validity"/>
                                <div class="o_row"><field name="date_start"/> to <field name="date_end"/></div>
                                <field name="company_id" options="{'no_create': True}"/>
                            </group>
                        </group>
                    </sheet>
                </form>
            </field>
        </record>

        <record id="product_supplierinfo_search_view" model="ir.ui.view">
            <field name="name">product.supplierinfo.search.view</field>
            <field name="model">product.supplierinfo</field>
            <field name="arch" type="xml">
                <search string="Vendor">
                    <field name="name"/>
                    <field name="product_tmpl_id"/>
                    <filter string="Active" name="active" domain="[('date_end', '&gt;=',  (context_today() - datetime.timedelta(days=1)).strftime('%%Y-%%m-%%d'))]"/>
                    <filter string="Archived" name="archived" domain="[('date_end', '&lt;',  (context_today() - datetime.timedelta(days=1)).strftime('%%Y-%%m-%%d'))]"/>
                    <group expand="0" string="Group By">
                        <filter string="Product" name="groupby_product" domain="[]" context="{'group_by': 'product_tmpl_id'}"/>
                        <filter string="Vendor" name="groupby_vendor" domain="[]" context="{'group_by': 'name'}"/>
                    </group>
                </search>
            </field>
        </record>

        <record id="product_supplierinfo_view_kanban" model="ir.ui.view">
            <field name="name">product.supplierinfo.kanban</field>
            <field name="model">product.supplierinfo</field>
            <field name="arch" type="xml">
                <kanban class="o_kanban_mobile">
                    <field name="min_qty"/>
                    <field name="delay"/>
                    <field name="price"/>
                    <field name="name"/>
                    <field name="currency_id"/>
                    <templates>
                        <t t-name="kanban-box">
                            <div class="oe_kanban_global_click">
                                <div class="row mb4">
                                    <strong class="col-6">
                                        <span t-esc="record.name.value"/>
                                    </strong>
                                    <strong class="col-6 text-right">
                                        <strong><field name="price" widget="monetary"/></strong>
                                    </strong>
                                    <div class="col-6">
                                        <span t-esc="record.min_qty.value"/>
                                    </div>
                                    <div class="col-6 text-right">
                                        <span t-esc="record.delay.value"/> days
                                    </div>
                                </div>
                            </div>
                        </t>
                    </templates>
                </kanban>
            </field>
        </record>

        <record id="product_supplierinfo_tree_view" model="ir.ui.view">
            <field name="name">product.supplierinfo.tree.view</field>
            <field name="model">product.supplierinfo</field>
            <field name="arch" type="xml">
                <tree string="Vendor Information" multi_edit="1">
                    <field name="sequence" widget="handle"/>
                    <field name="name" readonly="1"/>
                    <field name="product_id" readonly="1" optional="hide"
                        invisible="context.get('product_template_invisible_variant', False)"
                        groups="product.group_product_variant"/>
                    <field name="product_tmpl_id" string="Product" readonly="1"
                        invisible="context.get('visible_product_tmpl_id', True)"/>
                    <field name="product_name" optional="hide"/>
                    <field name="product_code" optional="hide"/>
                    <field name="currency_id" groups="base.group_multi_currency"/>
                    <field name="date_start" optional="hide"/>
                    <field name="date_end" optional="hide"/>
                    <field name="company_id" readonly="1" groups="base.group_multi_company"/>
                    <field name="min_qty"/>
                    <field name="product_uom" groups="uom.group_uom"/>
                    <field name="price" string="Price"/>
                    <field name="delay" optional="hide"/>
                </tree>
            </field>
        </record>

    <record id="product_supplierinfo_type_action" model="ir.actions.act_window">
        <field name="name">Vendor Pricelists</field>
        <field name="type">ir.actions.act_window</field>
        <field name="res_model">product.supplierinfo</field>
        <field name="view_mode">tree,form,kanban</field>
        <field name="context">{'visible_product_tmpl_id':False}</field>
        <field name="help" type="html">
            <p class="o_view_nocontent_smiling_face">
                No vendor pricelist found
            </p><p>
                Register the prices requested by your vendors for each product, based on the quantity and the period.
            </p>
        </field>
    </record>

    <record id="action_product_price_list_report" model="ir.actions.server">
        <field name="name">Generate Pricelist</field>
        <field name="groups_id" eval="[(4, ref('group_product_pricelist'))]"/>
        <field name="model_id" ref="product.model_product_product"/>
        <field name="binding_model_id" ref="product.model_product_product"/>
        <field name="state">code</field>
        <field name="code">
ctx = env.context
ctx.update({'default_pricelist': env['product.pricelist'].search([], limit=1).id})
action = {
    'name': 'Pricelist Report',
    'type': 'ir.actions.client',
    'tag': 'generate_pricelist',
    'context': ctx,
}
        </field>
    </record>

    </data>
</odoo>