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:
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user