From 4590da7c01f220838aeb8b8a5c42a930d06b4949 Mon Sep 17 00:00:00 2001 From: Laetitia Gangloff Date: Thu, 17 Mar 2016 12:23:09 +0100 Subject: [PATCH] Improve create of purchase order line to set it compatible with test_data --- purchase_packaging/models/purchase.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/purchase_packaging/models/purchase.py b/purchase_packaging/models/purchase.py index 5109d777d..ff7d14f2b 100644 --- a/purchase_packaging/models/purchase.py +++ b/purchase_packaging/models/purchase.py @@ -185,7 +185,7 @@ class PurchaseOrderLine(models.Model): @api.model def create(self, vals): - if 'product_qty' not in vals: + if 'product_qty' not in vals and 'product_purchase_qty' in vals: # compute product_qty to avoid inverse computation and reset to 1 uom_obj = self.env['product.uom'] product_purchase_uom = uom_obj.browse(