From b4e23a1e743422dfa4df09dc2efca8d5964aee41 Mon Sep 17 00:00:00 2001 From: Florent THOMAS Date: Thu, 16 Jan 2020 17:55:10 +0100 Subject: [PATCH 1/5] Backport of the issue https://github.com/OCA/account-financial-reporting/pull/615 from v12.0 --- account_financial_report_qweb/report/trial_balance.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_financial_report_qweb/report/trial_balance.py b/account_financial_report_qweb/report/trial_balance.py index f76288d1..7474972e 100644 --- a/account_financial_report_qweb/report/trial_balance.py +++ b/account_financial_report_qweb/report/trial_balance.py @@ -399,7 +399,7 @@ SELECT accgroup.parent_id, coalesce(accgroup.code_prefix, accgroup.name), accgroup.name, - accgroup.parent_left * 100000, + accgroup.code_prefix, accgroup.level FROM account_group accgroup""" From 18f81c8e20cb636ed2e5bd2b16a4a55ddf056653 Mon Sep 17 00:00:00 2001 From: Florent THOMAS Date: Thu, 16 Jan 2020 18:07:15 +0100 Subject: [PATCH 2/5] also change the type of field --- account_financial_report_qweb/report/trial_balance.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_financial_report_qweb/report/trial_balance.py b/account_financial_report_qweb/report/trial_balance.py index 7474972e..e894dc71 100644 --- a/account_financial_report_qweb/report/trial_balance.py +++ b/account_financial_report_qweb/report/trial_balance.py @@ -75,7 +75,7 @@ class TrialBalanceReportAccount(models.TransientModel): ) hide_line = fields.Boolean(compute='_compute_hide_line') # Data fields, used to keep link with real object - sequence = fields.Integer(index=True, default=1) + sequence = fields.Char(index=True, ) level = fields.Integer(index=True, default=1) # Data fields, used to keep link with real object From b066d65a0ba7e8b7474db197a7c846e070f8519c Mon Sep 17 00:00:00 2001 From: Florent THOMAS Date: Thu, 16 Jan 2020 18:17:22 +0100 Subject: [PATCH 3/5] also change the way sequence is computed --- account_financial_report_qweb/report/trial_balance.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_financial_report_qweb/report/trial_balance.py b/account_financial_report_qweb/report/trial_balance.py index e894dc71..66d66cd0 100644 --- a/account_financial_report_qweb/report/trial_balance.py +++ b/account_financial_report_qweb/report/trial_balance.py @@ -551,7 +551,7 @@ WHERE report_trial_balance_qweb_account.account_group_id = accgroup.id account account.""" query_update_account_group = """ UPDATE report_trial_balance_qweb_account -SET sequence = newline.sequence + 1, +SET sequence = CONCAT(newline.sequence, newline.code),, level = newline.level + 1 FROM report_trial_balance_qweb_account as newline WHERE newline.account_group_id = report_trial_balance_qweb_account.parent_id From c79ba741a4e307f556d7483f5af29926d1c1c579 Mon Sep 17 00:00:00 2001 From: Florent THOMAS Date: Thu, 16 Jan 2020 18:19:54 +0100 Subject: [PATCH 4/5] also change the way sequence is computed --- account_financial_report_qweb/report/trial_balance.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_financial_report_qweb/report/trial_balance.py b/account_financial_report_qweb/report/trial_balance.py index 66d66cd0..d24192f0 100644 --- a/account_financial_report_qweb/report/trial_balance.py +++ b/account_financial_report_qweb/report/trial_balance.py @@ -551,7 +551,7 @@ WHERE report_trial_balance_qweb_account.account_group_id = accgroup.id account account.""" query_update_account_group = """ UPDATE report_trial_balance_qweb_account -SET sequence = CONCAT(newline.sequence, newline.code),, +SET sequence = CONCAT(newline.sequence, newline.code), level = newline.level + 1 FROM report_trial_balance_qweb_account as newline WHERE newline.account_group_id = report_trial_balance_qweb_account.parent_id From b2bd913364a630ce968a8cacbf56dfd75de1c546 Mon Sep 17 00:00:00 2001 From: Florent THOMAS Date: Sat, 14 Mar 2020 10:10:47 +0100 Subject: [PATCH 5/5] Update trial_balance.py --- account_financial_report_qweb/report/trial_balance.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/account_financial_report_qweb/report/trial_balance.py b/account_financial_report_qweb/report/trial_balance.py index d24192f0..369316b1 100644 --- a/account_financial_report_qweb/report/trial_balance.py +++ b/account_financial_report_qweb/report/trial_balance.py @@ -75,7 +75,7 @@ class TrialBalanceReportAccount(models.TransientModel): ) hide_line = fields.Boolean(compute='_compute_hide_line') # Data fields, used to keep link with real object - sequence = fields.Char(index=True, ) + sequence = fields.Char(index=True) level = fields.Integer(index=True, default=1) # Data fields, used to keep link with real object