mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
[ADD] purchase_mrp_distribution: New module to distribute qty of move in diferent products
This module aims to address the need to receive a generic product, but until the moment of reception, we do not know the quantity that we might receive of its specific products. Using kits was not suitable for us, because to account for a unit of the kit product, the quantity specified in the BoM must be received. Therefore, we opted to define a new type of BoM called distribution. In this way, upon receiving a unit of any product added to the BoM, it will be accounted for as a unit of the generic product and will be reflected in the svls as separate products, but they will be accounted for in the purchase line as part of the product.
This commit is contained in:
committed by
Pedro M. Baeza
parent
0ca8110827
commit
0ea4e392c8
23
purchase_mrp_distribution/views/mrp_bom_views.xml
Normal file
23
purchase_mrp_distribution/views/mrp_bom_views.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<odoo>
|
||||
<record id="purchase_order_form" model="ir.ui.view">
|
||||
<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='type']/../p" position="after">
|
||||
<p
|
||||
colspan="2"
|
||||
class="oe_grey oe_edit_only"
|
||||
attrs="{'invisible': [('type','!=','distribution')]}"
|
||||
>
|
||||
A BoM of type distribution is used to select the quantities of components.
|
||||
<ul>
|
||||
<li>
|
||||
At a Stock Transfer.
|
||||
</li>
|
||||
</ul>
|
||||
</p>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
21
purchase_mrp_distribution/views/stock_picking_views.xml
Normal file
21
purchase_mrp_distribution/views/stock_picking_views.xml
Normal file
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<odoo>
|
||||
<record id="view_picking_form" model="ir.ui.view">
|
||||
<field name="model">stock.picking</field>
|
||||
<field name="inherit_id" ref="stock.view_picking_form" />
|
||||
<field name="arch" type="xml">
|
||||
<xpath
|
||||
expr="//field[@name='move_ids_without_package']/tree/field[@name='quantity_done']"
|
||||
position="after"
|
||||
>
|
||||
<field name="distribution_bom_id" invisible="1" />
|
||||
<button
|
||||
name="action_open_distribution_wizard"
|
||||
type="object"
|
||||
icon="fa-sitemap"
|
||||
attrs="{'invisible': ['|', ('distribution_bom_id', '=', False), ('state', 'in', ['done', 'cancel'])]}"
|
||||
/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user