diff --git a/account_financial_report/report/general_ledger.py b/account_financial_report/report/general_ledger.py index c4f39375..28593c40 100644 --- a/account_financial_report/report/general_ledger.py +++ b/account_financial_report/report/general_ledger.py @@ -483,7 +483,8 @@ class GeneralLedgerReport(models.AbstractModel): for tax_id in move_line["tax_ids"]: taxes_ids.add(tax_id) for analytic_account in move_line["analytic_distribution"] or {}: - analytic_ids.add(int(analytic_account)) + for analytic_account_id in analytic_account.split(","): + analytic_ids.add(int(analytic_account_id)) if move_line["full_reconcile_id"]: rec_id = move_line["full_reconcile_id"][0] if rec_id not in full_reconcile_ids: diff --git a/account_financial_report/report/general_ledger_xlsx.py b/account_financial_report/report/general_ledger_xlsx.py index 39603f3b..cd25d945 100644 --- a/account_financial_report/report/general_ledger_xlsx.py +++ b/account_financial_report/report/general_ledger_xlsx.py @@ -195,16 +195,17 @@ class GeneralLedgerXslx(models.AbstractModel): taxes_description += taxes_data[tax_id]["tax_name"] + " " if line["tax_line_id"]: taxes_description += line["tax_line_id"][1] - for account_id, value in line["analytic_distribution"].items(): - if value < 100: - analytic_distribution += "%s %d%% " % ( - analytic_data[int(account_id)]["name"], - value, - ) - else: - analytic_distribution += ( - f"{analytic_data[int(account_id)]['name']} " - ) + for account_ids, value in line["analytic_distribution"].items(): + for account_id in account_ids.split(","): + if value < 100: + analytic_distribution += "%s %d%% " % ( + analytic_data[int(account_id)]["name"], + value, + ) + else: + analytic_distribution += ( + f"{analytic_data[int(account_id)]['name']} " + ) line.update( { "taxes_description": taxes_description, @@ -303,18 +304,19 @@ class GeneralLedgerXslx(models.AbstractModel): taxes_description += ( taxes_data[tax_id]["tax_name"] + " " ) - for account_id, value in line[ + for account_ids, value in line[ "analytic_distribution" ].items(): - if value < 100: - analytic_distribution += "%s %d%% " % ( - analytic_data[int(account_id)]["name"], - value, - ) - else: - analytic_distribution += ( - f"{analytic_data[int(account_id)]['name']} " - ) + for account_id in account_ids.split(","): + if value < 100: + analytic_distribution += "%s %d%% " % ( + analytic_data[int(account_id)]["name"], + value, + ) + else: + analytic_distribution += ( + f"{analytic_data[int(account_id)]['name']} " + ) line.update( { "taxes_description": taxes_description, diff --git a/account_financial_report/report/templates/general_ledger.xml b/account_financial_report/report/templates/general_ledger.xml index 690010dd..42fe1779 100644 --- a/account_financial_report/report/templates/general_ledger.xml +++ b/account_financial_report/report/templates/general_ledger.xml @@ -480,22 +480,27 @@ t-as="analytic_id" >
- - - % - - + t-out="o._get_atr_from_dict(int(analytic_account_id), analytic_data, 'name')" + /> + + % + + +