File: mrp_bom_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 (308 lines) | stat: -rw-r--r-- 20,223 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
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
<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <data>
        <!-- Bill of Materials -->
        <record id="action_report_mrp_bom" model="ir.actions.client">
            <field name="name">BoM Overview</field>
            <field name="tag">mrp_bom_report</field>
            <field name="context">{'model': 'report.mrp.report_bom_structure'}</field>
        </record>

        <record id="mrp_bom_byproduct_form_view" model="ir.ui.view">
            <field name="name">mrp.bom.byproduct.form</field>
            <field name="model">mrp.bom.byproduct</field>
            <field name="arch" type="xml">
                <form string="Byproduct">
                    <group>
                        <field name="allowed_operation_ids" invisible="1"/>
                        <field name="company_id"/>
                        <field name="product_id"/>
                        <field name="product_uom_category_id" invisible="1"/>
                        <label for="product_qty"/>
                        <div class="o_row">
                            <field name="product_qty"/>
                            <field name="product_uom_id" groups="uom.group_uom"/>
                        </div>
                        <field name="operation_id" groups="mrp.group_mrp_routings" options="{'no_quick_create':True,'no_create_edit':True}"/>
                        <field name="possible_bom_product_template_attribute_value_ids" invisible="1"/>
                        <field name="bom_product_template_attribute_value_ids" widget="many2many_tags" options="{'no_create': True}" groups="product.group_product_variant"/>
                    </group>
                </form>
            </field>
        </record>

        <record id="mrp_bom_form_view" model="ir.ui.view">
            <field name="name">mrp.bom.form</field>
            <field name="model">mrp.bom</field>
            <field name="priority">100</field>
            <field name="arch" type="xml">
                <form string="Bill of Material">
                    <sheet>
                        <div class="oe_button_box" name="button_box" invisible="context.get('parent_production_id')">
                            <button name="%(action_mrp_routing_time)d" type="action" class="oe_stat_button" icon="fa-clock-o" groups="mrp.group_mrp_routings">
                                <div class="o_field_widget o_stat_info">
                                    <span class="o_stat_text">Operations<br/>Performance</span>
                                </div>
                            </button>
                            <button name="%(action_report_mrp_bom)d" type="action"
                                class="oe_stat_button" icon="fa-bars">
                                <div class="o_stat_info">
                                    <span class="o_stat_text">BoM Overview</span>
                                </div>
                            </button>
                        </div>
                        <widget name="web_ribbon" title="Archived" bg_color="text-bg-danger" invisible="active"/>
                    <group>
                        <group>
                            <field name="active" invisible="1"/>
                            <field name="company_id" invisible="1"/>
                            <field name="product_tmpl_id" context="{'default_is_storable': True}"/>
                            <field name="product_uom_category_id" invisible="1"/>
                            <field name="allow_operation_dependencies" invisible="1"/>
                            <field name="product_id" groups="product.group_product_variant" context="{'default_is_storable': True}"/>
                            <field name="product_id" groups="!product.group_product_variant" invisible="1"/>
                            <label for="product_qty" string="Quantity"/>
                            <div class="o_row">
                                <field name="product_qty"/>
                                <field name="product_uom_id" options="{'no_open':True,'no_create':True}" groups="uom.group_uom"/>
                            </div>
                        </group>
                        <group>
                            <field name="code"/>
                            <field name="type" widget="radio" invisible="context.get('parent_production_id')"/>
                            <p colspan="2" class="oe_grey oe_edit_only" invisible="type != 'phantom'">
                            <ul>
                                A BoM of type Kit is not produced with a manufacturing order.<br/>
                                Instead, it is used to decompose a BoM into its components when:
                                <li>
                                    it is added as a component in a manufacturing order
                                </li>
                                <li>
                                    it is moved via a transfer, such as a receipt or a delivery order for instance.
                                </li>
                            </ul>
                            </p>
                            <field name="company_id" groups="base.group_multi_company" options="{'no_create': True, 'no_open': True}" invisible="context.get('parent_production_id')"/>
                        </group>
                    </group>
                    <notebook>
                        <page string="Components" name="components">
                            <field name="bom_line_ids" widget="one2many" context="{'default_parent_product_tmpl_id': product_tmpl_id, 'default_product_id': False, 'default_bom_id': id}">
                                <list string="Components" editable="bottom">
                                    <control>
                                        <create string="Add a line"/>
                                        <button name="action_add_from_catalog" string="Catalog" type="object" class="px-4 btn-link" context="{'order_id': parent.id}"/>
                                    </control>
                                    <field name="company_id" column_invisible="True"/>
                                    <field name="sequence" widget="handle"/>
                                    <field name="product_id" context="{'default_is_storable': True}"/>
                                    <field name="product_tmpl_id" column_invisible="True"/>
                                    <button name="action_see_attachments" type="object" icon="fa-files-o" aria-label="Product Attachments" title="Product Attachments" class="float-end" column_invisible="context.get('parent_production_id')"/>
                                    <field name="attachments_count" class="text-start" string=" " column_invisible="context.get('parent_production_id')"/>
                                    <field name="product_qty"/>
                                    <field name="product_uom_category_id" column_invisible="True"/>
                                    <field name="parent_product_tmpl_id" column_invisible="True" />
                                    <field name="product_uom_id" options="{'no_open':True,'no_create':True}" groups="uom.group_uom"/>
                                    <field name="possible_bom_product_template_attribute_value_ids" column_invisible="True"/>
                                    <field name="bom_product_template_attribute_value_ids" optional="hide" widget="many2many_tags" options="{'no_create': True}" column_invisible="parent.product_id" groups="product.group_product_variant"/>
                                    <field name="allowed_operation_ids" column_invisible="True"/>
                                    <field name="operation_id" groups="mrp.group_mrp_routings" optional="hidden" column_invisible="parent.type not in ('normal', 'phantom')" options="{'no_quick_create':True,'no_create_edit':True}"/>
                                    <field name="manual_consumption" optional="hide" force_save="1"/>
                                </list>
                            </field>
                        </page>
                        <page string="Operations"
                            name="operations"
                            invisible="type not in ('normal', 'phantom')"
                            groups="mrp.group_mrp_routings">
                                <field name="operation_ids"
                                    invisible="type not in ('normal', 'phantom')"
                                    groups="mrp.group_mrp_routings"
                                    context="{'bom_id_invisible': True, 'default_bom_id': id, 'list_view_ref': 'mrp.mrp_routing_workcenter_bom_tree_view'}"/>
                        </page>
                        <page string="By-products"
                            name="by_products"
                            invisible="type != 'normal'"
                            groups="mrp.group_mrp_byproducts">
                            <field name="byproduct_ids" context="{'form_view_ref' : 'mrp.mrp_bom_byproduct_form_view', 'default_bom_id': id}">
                                <list string="By-products"  editable="top">
                                    <control>
                                        <create string="Add a line"/>
                                        <button name="action_add_from_catalog" string="Catalog" type="object" class="px-4 btn-link" context="{'order_id': parent.id}"/>
                                    </control>
                                    <field name="company_id" column_invisible="True"/>
                                    <field name="product_uom_category_id" column_invisible="True"/>
                                    <field name="sequence" widget="handle"/>
                                    <field name="product_id" context="{'default_is_storable': True}"/>
                                    <field name="product_qty"/>
                                    <field name="product_uom_id" groups="uom.group_uom"/>
                                    <field name="cost_share" optional="hide"/>
                                    <field name="allowed_operation_ids" column_invisible="True"/>
                                    <field name="operation_id" groups="mrp.group_mrp_routings" options="{'no_quick_create':True,'no_create_edit':True}"/>
                                    <field name="possible_bom_product_template_attribute_value_ids" column_invisible="True"/>
                                    <field name="bom_product_template_attribute_value_ids" optional="hide" widget="many2many_tags" options="{'no_create': True}" column_invisible="parent.product_id" groups="product.group_product_variant"/>
                                </list>
                            </field>
                       </page>
                        <page string="Miscellaneous" name="miscellaneous">
                            <group>
                                <group>
                                    <field name="ready_to_produce" invisible="type == 'phantom'" string="Manufacturing Readiness" widget="radio" groups="mrp.group_mrp_routings"/>
                                    <field name="consumption" invisible="type == 'phantom'" widget="radio"/>
                                    <field name="allow_operation_dependencies" groups="mrp.group_mrp_workorder_dependencies"/>
                                </group>
                                <group>
                                    <field name="picking_type_id" invisible="type == 'phantom'" string="Routing" groups="stock.group_adv_location"/>
                                    <label for="produce_delay" string="Manuf. Lead Time"/>
                                    <div>
                                        <field name="produce_delay" class="oe_inline"/> days
                                    </div>
                                    <label for="days_to_prepare_mo"/>
                                    <div>
                                        <field name="days_to_prepare_mo" class="oe_inline"/> days
                                        <button name="action_compute_bom_days" string="Compute" type="object"
                                                help="Compute the days required to resupply all components from BoM, by either buying or manufacturing the components and/or subassemblies.
                                                      Also note that purchase security lead times will be added when appropriate."
                                                class="oe_link pt-0"/>
                                    </div>
                                </group>
                            </group>
                        </page>
                    </notebook>
                    </sheet>
                    <chatter reload_on_attachment="True" open_attachments="True"/>
                </form>
            </field>
        </record>

        <record id="mrp_bom_tree_view" model="ir.ui.view">
            <field name="name">mrp.bom.list</field>
            <field name="model">mrp.bom</field>
            <field name="arch" type="xml">
                <list string="Bill of Materials" sample="1" multi_edit="1">
                    <field name="active" column_invisible="True"/>
                    <field name="sequence" widget="handle"/>
                    <field name="company_id" column_invisible="True"/>
                    <field name="product_tmpl_id"/>
                    <field name="code" optional="show"/>
                    <field name="type"/>
                    <field name="product_id" groups="product.group_product_variant" optional="hide"/>
                    <field name="company_id" groups="base.group_multi_company" optional="show"/>
                    <field name="product_qty" optional="hide"/>
                    <field name="product_uom_category_id" column_invisible="True"/>
                    <field name="product_uom_id" groups="uom.group_uom" optional="hide" string="Unit of Measure"/>
                </list>
            </field>
        </record>

        <record id="mrp_bom_kanban_view" model="ir.ui.view">
            <field name="name">mrp.bom.kanban</field>
            <field name="model">mrp.bom</field>
            <field name="arch" type="xml">
                <kanban class="o_kanban_mobile" sample="1">
                    <templates>
                        <t t-name="card">
                            <div>
                                <field name="product_tmpl_id" class="fw-medium fs-5"/>
                                <span class="float-end badge rounded-pill"><field name="product_qty"/> <field name="product_uom_id" class="small"/></span>
                            </div>
                            <footer class="pt-1">
                                <field name="code"/>
                            </footer>
                        </t>
                    </templates>
                </kanban>
            </field>
        </record>

        <record id="view_mrp_bom_filter" model="ir.ui.view">
            <field name="name">mrp.bom.select</field>
            <field name="model">mrp.bom</field>
            <field name="arch" type="xml">
                <search string="Search Bill Of Material">
                    <field name="code" string="Bill of Materials" filter_domain="['|', ('code', 'ilike', self), ('product_tmpl_id', 'ilike', self)]"/>
                    <field name="product_tmpl_id" string="Product"/>
                    <field name="bom_line_ids" string="Component"/>
                    <filter string="Manufacturing" name="normal" domain="[('type', '=', 'normal')]"/>
                    <filter string="Kit" name="phantom" domain="[('type', '=', 'phantom')]"/>
                    <separator/>
                    <filter string="Archived" name="inactive" domain="[('active', '=', False)]"/>
                    <group expand="0" string="Group By...">
                        <filter string="Product" name="product" domain="[]" context="{'group_by': 'product_tmpl_id'}"/>
                        <filter string='BoM Type' name="group_by_type" domain="[]" context="{'group_by' : 'type'}"/>
                        <filter string='Unit of Measure' name="default_unit_of_measure" domain="[]" context="{'group_by' : 'product_uom_id'}"/>
                   </group>
                </search>
            </field>
        </record>

        <record id="mrp_bom_form_action" model="ir.actions.act_window">
            <field name="name">Bills of Materials</field>
            <field name="res_model">mrp.bom</field>
            <field name="domain">[]</field> <!-- force empty -->
            <field name="view_mode">list,kanban,form</field>
            <field name="search_view_id" ref="view_mrp_bom_filter"/>
            <field name="context">{'default_company_id': allowed_company_ids[0]}</field>
            <field name="help" type="html">
              <p class="o_view_nocontent_smiling_face">
                No bill of materials found. Let's create one!
              </p><p>
                Bills of materials allow you to define the list of required raw
                materials used to make a finished product; through a manufacturing
                order or a pack of products.
              </p>
            </field>
        </record>

        <menuitem id="menu_mrp_bom_form_action"
            action="mrp_bom_form_action"
            parent="menu_mrp_bom"
            sequence="13"/>

        <!-- BOM Line -->
        <record id="mrp_bom_line_view_form" model="ir.ui.view">
            <field name="name">mrp.bom.line.view.form</field>
            <field name="model">mrp.bom.line</field>
            <field name="arch" type="xml">
                <form string="Bill of Material line" create="0" edit="0">
                    <sheet>
                        <group>
                            <group string="Component">
                                <field name="product_id"/>
                                <field name="parent_product_tmpl_id" invisible="1"/>
                                <label for="product_qty" string="Quantity"/>
                                <div class="o_row">
                                    <field name="product_qty"/>
                                    <field name="product_uom_category_id" invisible="1"/>
                                    <field name="product_uom_id" options="{'no_open':True,'no_create':True}" groups="uom.group_uom"/>
                                </div>
                                <field name="possible_bom_product_template_attribute_value_ids" invisible="1"/>
                                <field name="bom_product_template_attribute_value_ids" widget="many2many_tags" options="{'no_create': True}" groups="product.group_product_variant"/>
                            </group>
                            <group string="Operation">
                                <field name="company_id" invisible="1"/>
                                <field name="sequence" groups="base.group_no_one"/>
                                <field name="allowed_operation_ids" invisible="1"/>
                                <field name="operation_id" groups="mrp.group_mrp_routings"/>
                            </group>
                        </group>
                    </sheet>
                </form>
            </field>
        </record>

        <record id="template_open_bom" model="ir.actions.act_window">
            <field name="context">{'default_product_tmpl_id': active_id}</field>
            <field name="name">Bill of Materials</field>
            <field name="res_model">mrp.bom</field>
            <field name="domain">['|', ('product_tmpl_id', '=', active_id), ('byproduct_ids.product_id.product_tmpl_id', '=', active_id)]</field>
        </record>

        <record id="product_open_bom" model="ir.actions.act_window">
            <field name="context">{'default_product_id': active_id}</field>
            <field name="name">Bill of Materials</field>
            <field name="res_model">mrp.bom</field>
            <field name="domain">[]</field> <!-- Force empty -->
        </record>
    </data>
</odoo>