From 96143348ae1fd50fec7c944b8034633afc31dcbd Mon Sep 17 00:00:00 2001 From: William Henrotin Date: Tue, 18 Sep 2018 16:23:33 +0200 Subject: [PATCH] [FIX] product: lock uom in edition On product packaging model, the uom is related to the product uom but but editable. This can lead to some error in the database. This commit set it as readonly to avoid any mistake. Co-authored-by: Denis Roussel --- addons/product/models/product.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/product/models/product.py b/addons/product/models/product.py index aafc17190a5..12ddf1d9734 100644 --- a/addons/product/models/product.py +++ b/addons/product/models/product.py @@ -593,7 +593,7 @@ class ProductPackaging(models.Model): product_id = fields.Many2one('product.product', string='Product') qty = fields.Float('Contained Quantity', help="The total number of products you can have per pallet or box.") barcode = fields.Char('Barcode', copy=False, help="Barcode used for packaging identification.") - product_uom_id = fields.Many2one('uom.uom', related='product_id.uom_id') + product_uom_id = fields.Many2one('uom.uom', related='product_id.uom_id', readonly=True) class SupplierInfo(models.Model):