Do not use Mock product to check_formula

issue8713
review268081002
This commit is contained in:
Cédric Krier committed 2019-10-15 17:33:12 +02:00
1 parent ad4da24c17
commit 03967681b8
1 file changed
+1 -12
+1 -12
View File
@@ -129,23 +129,12 @@ class PriceListLine(sequence_ordered(), ModelSQL, ModelView, MatchMixin):
for line in lines:
line.check_formula()
@classmethod
def get_check_formula_product(cls):
pool = Pool()
Product = pool.get('product.product')
class Mock(Product):
def get_multivalue(self, name, **pattern):
return Decimal(0)
product = Mock()
return product
def check_formula(self):
'''
Check formula
'''
context = self.price_list.get_context_formula(
None, self.get_check_formula_product(), Decimal('0'), 0, None)
None, None, Decimal('0'), 0, None)
try:
if not isinstance(self.get_unit_price(**context), Decimal):