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:
1 parent
0fbb9b43cd
commit
f0d98649d0
1 file changed
+2
-2
@@ -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
|
||||
|
||||
Reference in new issue
Block a user