From 1c6437b9c381df54d554b714117cde6feb86e9de Mon Sep 17 00:00:00 2001 From: Sergi Almacellas Abellana Date: Fri, 28 Oct 2016 09:51:29 +0200 Subject: [PATCH] Avoid reading all category uoms when testing uom.category issue5982 review28951002 --- invoice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/invoice.py b/invoice.py index 39b01d48b2..a67f7e3641 100644 --- a/invoice.py +++ b/invoice.py @@ -1782,7 +1782,7 @@ class InvoiceLine(sequence_ordered(), ModelSQL, ModelView, TaxableMixin): self.description = Product(self.product.id).rec_name category = self.product.default_uom.category - if not self.unit or self.unit not in category.uoms: + if not self.unit or self.unit.category != category: self.unit = self.product.default_uom.id self.unit_digits = self.product.default_uom.digits