Avoid reading all category uoms when testing uom.category

issue5982
review30701002
This commit is contained in:
Sergi Almacellas Abellana committed 2016-10-28 09:55:45 +02:00
1 parent 18e5d06f54
commit f755219855
1 file changed
+1 -2
+1 -2
View File
@@ -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