Use list price used of product to calculate the dunning fee

Since 117e51123978 the multi-value list price field is also defined on variant
and it may be None. The list price used must be used instead.

Closes #14344
This commit is contained in:
Cédric Krier
2025-11-01 13:04:15 +01:00
parent a21df22391
commit 1299094185
+6 -3
View File
@@ -30,9 +30,12 @@ class Fee(DeactivableMixin, ModelSQL, ModelView):
'required': Eval('compute_method') == 'percentage',
})
def get_list_price(self, dunning, **pattern):
pattern.setdefault('company', dunning.company.id)
return self.product.get_multivalue('list_price', **pattern)
def get_list_price(self, dunning):
pool = Pool()
Product = pool.get('product.product')
with Transaction().set_context(company=dunning.company.id):
product = Product(self.product)
return product.list_price_used
def get_amount(self, dunning):
'Return fee amount and currency'