Skip to content
Permalink
Browse files

[FIX] mrp: by-products typo + default type on product

Be consistent with by-products and byproducts. Only use by-products.
When a product is created from the BoM view, it has a default type
as storable product, set the same type when the product is created
from by-products tab.
  • Loading branch information...
amoyaux committed Mar 25, 2019
1 parent 6610db1 commit 832a5479234433e9988a114e604d61cc9cd3c686
Showing with 6 additions and 6 deletions.
  1. +2 −2 addons/mrp/models/mrp_bom.py
  2. +4 −4 addons/mrp/views/mrp_bom_views.xml
@@ -352,11 +352,11 @@ class MrpSubProduct(models.Model):

product_id = fields.Many2one('product.product', 'Product', required=True)
product_qty = fields.Float(
'Product Qty',
'Quantity',
default=1.0, digits=dp.get_precision('Product Unit of Measure'), required=True)
product_uom_id = fields.Many2one('uom.uom', 'Unit of Measure', required=True)
bom_id = fields.Many2one('mrp.bom', 'BoM', ondelete='cascade')
operation_id = fields.Many2one('mrp.routing.workcenter', 'Produced at Operation')
operation_id = fields.Many2one('mrp.routing.workcenter', 'Produced in Operation')

@api.onchange('product_id')
def onchange_product_id(self):
@@ -69,15 +69,15 @@
</tree>
</field>
</page>
<page string="Byproducts" attrs="{'invisible': [('type','=','phantom')]}" groups="mrp.group_mrp_byproducts">
<page string="By-products" attrs="{'invisible': [('type','=','phantom')]}" groups="mrp.group_mrp_byproducts">
<field name="sub_products">
<tree string="Byproducts" editable="top">
<field name="product_id"/>
<tree string="By-products" editable="top">
<field name="product_id" context="{'default_type': 'product'}"/>
<field name="product_qty"/>
<field name="product_uom_id" groups="uom.group_uom"/>
<field name="operation_id" groups="mrp.group_mrp_routings" domain="[('routing_id', '=', parent.routing_id)]" options="{'no_quick_create':True,'no_create_edit':True}"/>
</tree>
<form string="Byproducts">
<form string="By-products">
<field name="product_id"/>
<field name="product_qty"/>
<field name="product_uom_id" groups="uom.group_uom"/>

0 comments on commit 832a547

Please sign in to comment.
You can’t perform that action at this time.