From f75521985502883b2bfb6d5d04221edb7094cd73 Mon Sep 17 00:00:00 2001 From: Sergi Almacellas Abellana Date: Fri, 28 Oct 2016 09:55:45 +0200 Subject: [PATCH] Avoid reading all category uoms when testing uom.category issue5982 review30701002 --- opportunity.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/opportunity.py b/opportunity.py index e76d3b358d..d59f3afebe 100644 --- a/opportunity.py +++ b/opportunity.py @@ -483,8 +483,7 @@ class SaleOpportunityLine(sequence_ordered(), ModelSQL, ModelView): return category = self.product.sale_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.sale_uom self.unit_digits = self.product.sale_uom.digits