[ADD] mrp_packaging_default: product packaging data in MRP

This module allows and encourages the use of packaging within MRP, both to manufacture products or to create kits.

@moduon MT-4506
This commit is contained in:
Jairo Llopis
2023-12-21 13:52:32 +00:00
parent 449893e75f
commit 5b75b1bdc8
20 changed files with 1224 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2023 Moduon Team S.L.
License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl-3.0) -->
<data>
<record id="mrp_bom_form_view" model="ir.ui.view">
<field name="name">Product packaging</field>
<field name="model">mrp.bom</field>
<field name="inherit_id" ref="mrp.mrp_bom_form_view" />
<field name="arch" type="xml">
<xpath
expr="//field[@name='bom_line_ids']/tree/field[@name='product_qty']"
position="before"
>
<field
name="product_packaging_id"
optional="show"
groups="product.group_stock_packaging"
/>
<field
name="product_packaging_qty"
optional="show"
groups="product.group_stock_packaging"
attrs="{'invisible': [('product_packaging_id', '=', False)]}"
/>
</xpath>
</field>
</record>
</data>

View File

@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2023 Moduon Team S.L.
License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl-3.0) -->
<data>
<record id="mrp_production_form_view" model="ir.ui.view">
<field name="name">Product packaging</field>
<field name="model">mrp.production</field>
<field name="inherit_id" ref="mrp.mrp_production_form_view" />
<field name="arch" type="xml">
<xpath
expr="//field[@name='move_finished_ids']/tree/field[@name='product_uom_qty']"
position="before"
>
<field
name="product_packaging_id"
optional="show"
groups="product.group_stock_packaging"
/>
<field
name="product_packaging_qty"
optional="show"
groups="product.group_stock_packaging"
attrs="{'invisible': [('product_packaging_id', '=', False)]}"
/>
</xpath>
<xpath
expr="//field[@name='move_raw_ids']/tree/field[@name='product_uom_qty']"
position="before"
>
<field
name="product_packaging_id"
optional="show"
groups="product.group_stock_packaging"
/>
<field
name="product_packaging_qty"
optional="show"
groups="product.group_stock_packaging"
attrs="{'invisible': [('product_packaging_id', '=', False)]}"
/>
</xpath>
</field>
</record>
</data>