[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.
This commit is contained in:
@@ -364,13 +364,13 @@ class MrpSubProduct(models.Model):
|
||||
_name = 'mrp.subproduct'
|
||||
_description = 'Byproduct'
|
||||
|
||||
product_id = fields.Many2one('product.product', 'Product', required=True)
|
||||
product_id = fields.Many2one('product.product', 'By-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','!=','normal')]}" groups="mrp.group_mrp_byproducts">
|
||||
<page string="By-products" attrs="{'invisible': [('type','!=','normal')]}" 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"/>
|
||||
|
||||
Reference in New Issue
Block a user