From f0d98649d089aa86cc5e24bc613b9e1d67506dc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sun, 27 Oct 2024 12:56:22 +0100 Subject: [PATCH] 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. --- modules/account_budget/account.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/account_budget/account.py b/modules/account_budget/account.py index d8931e6671..6929f2bd7d 100644 --- a/modules/account_budget/account.py +++ b/modules/account_budget/account.py @@ -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