From 1299094185d1b34c2af33bb79bbfba68cc47e3d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 1 Nov 2025 13:04:15 +0100 Subject: [PATCH] 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 --- modules/account_dunning_fee/dunning.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/account_dunning_fee/dunning.py b/modules/account_dunning_fee/dunning.py index e3d75edd4d..747031da90 100644 --- a/modules/account_dunning_fee/dunning.py +++ b/modules/account_dunning_fee/dunning.py @@ -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'