diff --git a/addons/mrp/models/mrp_bom.py b/addons/mrp/models/mrp_bom.py index 26456acc724..a6d2ab4f297 100644 --- a/addons/mrp/models/mrp_bom.py +++ b/addons/mrp/models/mrp_bom.py @@ -43,7 +43,8 @@ class MrpBom(models.Model): product_uom_id = fields.Many2one( 'uom.uom', 'Product Unit of Measure', default=_get_default_product_uom_id, oldname='product_uom', required=True, - help="Unit of Measure (Unit of Measure) is the unit of measurement for the inventory control") + help="Unit of Measure (Unit of Measure) is the unit of measurement for the inventory control", domain="[('category_id', '=', product_uom_category_id)]") + product_uom_category_id = fields.Many2one(related='product_id.uom_id.category_id') sequence = fields.Integer('Sequence', help="Gives the sequence order when displaying a list of bills of material.") routing_id = fields.Many2one( 'mrp.routing', 'Routing', @@ -233,7 +234,8 @@ class MrpBomLine(models.Model): 'uom.uom', 'Product Unit of Measure', default=_get_default_product_uom_id, oldname='product_uom', required=True, - help="Unit of Measure (Unit of Measure) is the unit of measurement for the inventory control") + help="Unit of Measure (Unit of Measure) is the unit of measurement for the inventory control", domain="[('category_id', '=', product_uom_category_id)]") + product_uom_category_id = fields.Many2one(related='product_id.uom_id.category_id') sequence = fields.Integer( 'Sequence', default=1, help="Gives the sequence order when displaying.") diff --git a/addons/mrp/views/mrp_bom_views.xml b/addons/mrp/views/mrp_bom_views.xml index 26d8b27dde7..0d68a231435 100644 --- a/addons/mrp/views/mrp_bom_views.xml +++ b/addons/mrp/views/mrp_bom_views.xml @@ -26,6 +26,7 @@ +