File: product_views.xml

package info (click to toggle)
odoo 18.0.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 878,716 kB
  • sloc: javascript: 927,937; python: 685,670; xml: 388,524; sh: 1,033; sql: 415; makefile: 26
file content (160 lines) | stat: -rw-r--r-- 8,765 bytes parent folder | download
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
<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <data>
        <!-- Product Template -->
        <record id="view_mrp_product_template_form_inherited" model="ir.ui.view">
            <field name="name">product.form.mrp.inherited</field>
            <field name="model">product.template</field>
            <field name="inherit_id" ref="stock.view_template_property_form"/>
            <field name="arch" type="xml">
                <xpath expr="//field[@name='product_variant_count']" position="after">
                    <field name="is_kits" invisible="1"/>
                </xpath>
            </field>
        </record>

        <record id="mrp_product_template_search_view" model="ir.ui.view">
            <field name="name">mrp.product.template.search</field>
            <field name="model">product.template</field>
            <field name="mode">primary</field>
            <field name="inherit_id" ref="product.product_template_search_view"/>
            <field name="arch" type="xml">
                <filter name="combo" position="after">
                    <separator/>
                    <filter string="Manufactured Products" name="manufactured_products" domain="[('bom_ids', '!=', False)]"/>
                    <filter string="BoM Components" name="components" domain="[('bom_line_ids', '!=', False)]"/>
                </filter>
            </field>
        </record>

        <record id="mrp_product_product_search_view" model="ir.ui.view">
            <field name="name">mrp.product.product.search</field>
            <field name="model">product.product</field>
            <field name="mode">primary</field>
            <field name="inherit_id" ref="product.product_search_form_view"/>
            <field name="arch" type="xml">
                <filter name="combo" position="after">
                    <separator/>
                    <filter string="Manufactured Products" name="manufactured_products" domain="[('bom_ids', '!=', False)]"/>
                    <filter string="BoM Components" name="components" domain="[('bom_line_ids', '!=', False)]"/>
                </filter>
            </field>
        </record>

        <record id="product_template_action" model="ir.actions.act_window">
            <field name="name">Products</field>
            <field name="res_model">product.template</field>
            <field name="search_view_id" ref="mrp_product_template_search_view"/>
            <field name="view_mode">kanban,list,form</field>
            <field name="context">{"search_default_goods": 1, 'default_is_storable': True}</field>
            <field name="help" type="html">
              <p class="o_view_nocontent_smiling_face">
                No product found. Let's create one!
              </p><p>
                Define the components and finished products you wish to use in
                bill of materials and manufacturing orders.
              </p>
            </field>
        </record>

        <record id="product_view_search_catalog" model="ir.ui.view">
            <field name="name">product.view.search.catalog.inherit.mrp</field>
            <field name="inherit_id" ref="product.product_view_search_catalog"/>
            <field name="model">product.product</field>
            <field name="arch" type="xml">
                <filter name="goods" position="after">
                    <filter string="In the BoM"
                            invisible="context.get('active_model') != 'mrp.bom.line'"
                            name="products_in_bom"
                            domain="[('product_catalog_product_is_in_bom', '=', True)]"/>
                    <filter string="In the MO"
                            invisible="context.get('active_model') != 'stock.move' or
                                       context.get('product_catalog_order_model') != 'mrp.production'"
                            name="products_in_mo"
                            domain="[('product_catalog_product_is_in_mo', '=', True)]"/>
                </filter>
            </field>
        </record>

        <menuitem id="menu_mrp_product_form"
            name="Products"
            action="product_template_action"
            parent="menu_mrp_bom" sequence="1"/>

        <record id="mrp_product_variant_action" model="ir.actions.act_window">
            <field name="name">Product Variants</field>
            <field name="res_model">product.product</field>
            <field name="search_view_id" ref="mrp_product_product_search_view"/>
            <field name="view_mode">kanban,list,form</field>
        </record>

        <menuitem id="product_variant_mrp" name="Product Variants"
            action="mrp_product_variant_action"
            parent="menu_mrp_bom" groups="product.group_product_variant" sequence="2"/>


        <record id="product_template_form_view_bom_button" model="ir.ui.view">
            <field name="name">product.template.procurement</field>
            <field name="model">product.template</field>
            <field name="inherit_id" ref="stock.product_template_form_view_procurement_button"/>
            <field name="arch" type="xml">
                <button name="action_open_documents" position="before">
                    <button class="oe_stat_button" name="%(template_open_bom)d" type="action"
                        groups="mrp.group_mrp_user"
                        invisible="type != 'consu'" icon="fa-flask">
                        <field string="Bill of Materials" name="bom_count" widget="statinfo" />
                    </button>
                </button>
                <button name="action_open_documents" position="after">
                    <button class="oe_stat_button" name="action_used_in_bom" type="object"
                        groups="mrp.group_mrp_user"
                        invisible="type != 'consu' or used_in_bom_count == 0" icon="fa-level-up">
                        <field string="Used In" name="used_in_bom_count" widget="statinfo" />
                    </button>
                    <button class="oe_stat_button" name="action_view_mos" type="object"
                        groups="mrp.group_mrp_user"
                        invisible="type != 'consu' or bom_count == 0 or mrp_product_qty == 0" icon="fa-list-alt" help="Manufactured in the last 365 days">
                        <div class="o_field_widget o_stat_info">
                            <span class="o_stat_value">
                                <field name="mrp_product_qty" widget="statinfo" nolabel="1" class="mr4"/>
                                <field name="uom_name"/>
                            </span>
                            <span class="o_stat_text">Manufactured</span>
                        </div>
                    </button>
                </button>
            </field>
        </record>

        <record id="product_product_form_view_bom_button" model="ir.ui.view">
            <field name="name">product.product.procurement</field>
            <field name="model">product.product</field>
            <field name="inherit_id" ref="stock.product_form_view_procurement_button"/>
            <field name="arch" type="xml">
                <xpath expr="//button[@name='action_open_product_lot']" position="after">
                    <button class="oe_stat_button" name="action_view_bom" type="object"
                        groups="mrp.group_mrp_user"
                        invisible="type != 'consu'" icon="fa-flask">
                        <field string="Bill of Materials" name="bom_count" widget="statinfo" />
                    </button>
                    <button class="oe_stat_button" name="action_used_in_bom" type="object"
                        groups="mrp.group_mrp_user"
                        invisible="type != 'consu' or used_in_bom_count == 0" icon="fa-level-up">
                        <field string="Used In" name="used_in_bom_count" widget="statinfo" />
                    </button>
                    <button class="oe_stat_button" name="action_view_mos" type="object"
                        groups="mrp.group_mrp_user"
                        invisible="type != 'consu' or bom_count == 0 or mrp_product_qty == 0" icon="fa-list-alt" help="Manufactured in the last 365 days">
                        <div class="o_field_widget o_stat_info">
                            <span class="o_stat_value">
                                <field name="mrp_product_qty" widget="statinfo" nolabel="1" class="mr4"/>
                                <field name="uom_name"/>
                            </span>
                            <span class="o_stat_text">Manufactured</span>
                        </div>
                    </button>
                </xpath>
            </field>
        </record>
    </data>
</odoo>