From 689cc4935c3cf4826ecbc30de051bc2554952149 Mon Sep 17 00:00:00 2001 From: Juhil Somaiya Date: Mon, 10 Dec 2018 06:29:33 +0000 Subject: [PATCH] [FIX] mrp: fixed product inventory uom issue Before this commit, we are getting error that product_uom must be matched because when we're adding line to inventory after updating the quantity, product_uom changes to Units. After this commit, error will not be generated as the default value of product_uom_id is removed. Fixes #29305 closes odoo/odoo#29371 --- addons/stock/models/stock_inventory.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/stock/models/stock_inventory.py b/addons/stock/models/stock_inventory.py index 682fb083da1..5ed14e6d3a0 100644 --- a/addons/stock/models/stock_inventory.py +++ b/addons/stock/models/stock_inventory.py @@ -331,8 +331,7 @@ class InventoryLine(models.Model): index=True, required=True) product_uom_id = fields.Many2one( 'uom.uom', 'Product Unit of Measure', - required=True, - default=lambda self: self.env.ref('uom.product_uom_unit', raise_if_not_found=True)) + required=True) product_uom_category_id = fields.Many2one(string='Uom category', related='product_uom_id.category_id', readonly=True) product_qty = fields.Float( 'Checked Quantity',