Copy root lines as line when copying budget

Since b7a82bf780b4 the root lines field is no more copied and as lines are not
copied by default, we must copy the root lines as lines.
This commit is contained in:
Cédric Krier committed 2024-10-27 12:56:22 +01:00
1 parent 0fbb9b43cd
commit f0d98649d0
1 file changed
+2 -2
+2 -2
View File
@@ -109,7 +109,7 @@ class BudgetMixin:
default = {}
else:
default = default.copy()
default.setdefault('lines')
default.setdefault('lines', lambda data: data['root_lines'])
return super().copy(budgets, default=default)
@@ -768,7 +768,7 @@ class CopyBudgetMixin:
factor = self.start.factor
if factor != 1:
currency = self.start.company.currency
default['root_lines.amount'] = (
default['lines.amount'] = (
lambda data: currency.round(data['amount'] * factor)
if data['amount'] else data['amount'])
return default