From 5d062fb1b4ae6030c0acdf5014a75e1cbe145ca8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 17 Jan 2025 00:03:03 +0100 Subject: [PATCH] Use company from the record when copying budget Since ba6b8ce0e692 only the fields displayed on the form state are set but the copy wizard for analytic budget does not have any field depending on the company so no default value is set for company. Indeed we should not rely on the state view to retrieve the currency from the company. Closes #13824 --- modules/account_budget/account.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/account_budget/account.py b/modules/account_budget/account.py index e9a2f3349b..ce30f6b29b 100644 --- a/modules/account_budget/account.py +++ b/modules/account_budget/account.py @@ -763,7 +763,7 @@ class CopyBudgetMixin: default = {'name': self.start.name} factor = self.start.factor if factor != 1: - currency = self.start.company.currency + currency = self.record.company.currency default['lines.amount'] = ( lambda data: currency.round(data['amount'] * factor) if data['amount'] else data['amount'])