Skip to content
Snippets Groups Projects
Commit 8e4efd98 authored by Swapnesh Shah's avatar Swapnesh Shah Committed by GitHub
Browse files

[FIX] mrp: show uom correctly


Before this commit, field`product_uom_category_id` was related to `product_id` which is not required and will be visible when Variants are not enabled so on such conditions no `Unit of Measure` was displayed. (As product_uom_category_id is False )

With this commit, we make this field related to `product_tmpl_id` which sets correct `product_uom_category_id` which thus we can see correct list of  `Unit of Measure`.

closes odoo/odoo#48687

Signed-off-by: default avatarRémy Voet <ryv-odoo@users.noreply.github.com>
parent c08f6e3e
No related branches found
No related tags found
No related merge requests found
......@@ -46,7 +46,7 @@ class MrpBom(models.Model):
'uom.uom', 'Unit of Measure',
default=_get_default_product_uom_id, required=True,
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')
product_uom_category_id = fields.Many2one(related='product_tmpl_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', check_company=True,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment