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
This commit is contained in:
Cédric Krier committed 2025-01-17 00:03:03 +01:00
1 parent 6fb00e2bed
commit 5d062fb1b4
1 file changed
+1 -1
+1 -1
View File
@@ -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'])