odoo-addon-account-financial-report 17.0.1.6.2__py3-none-any.whl → 17.0.1.6.10__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of odoo-addon-account-financial-report might be problematic. Click here for more details.

Files changed (34) hide show
  1. odoo/addons/account_financial_report/README.rst +6 -2
  2. odoo/addons/account_financial_report/__manifest__.py +1 -1
  3. odoo/addons/account_financial_report/i18n/account_financial_report.pot +9 -0
  4. odoo/addons/account_financial_report/i18n/ar.po +10 -1
  5. odoo/addons/account_financial_report/i18n/ca.po +10 -1
  6. odoo/addons/account_financial_report/i18n/de.po +10 -1
  7. odoo/addons/account_financial_report/i18n/es.po +10 -1
  8. odoo/addons/account_financial_report/i18n/es_AR.po +10 -1
  9. odoo/addons/account_financial_report/i18n/es_MX.po +10 -1
  10. odoo/addons/account_financial_report/i18n/fr.po +131 -491
  11. odoo/addons/account_financial_report/i18n/fr_CH.po +108 -427
  12. odoo/addons/account_financial_report/i18n/hr.po +10 -1
  13. odoo/addons/account_financial_report/i18n/hr_HR.po +10 -1
  14. odoo/addons/account_financial_report/i18n/it.po +14 -3
  15. odoo/addons/account_financial_report/i18n/ja.po +10 -1
  16. odoo/addons/account_financial_report/i18n/nl.po +10 -1
  17. odoo/addons/account_financial_report/i18n/nl_NL.po +10 -1
  18. odoo/addons/account_financial_report/i18n/pt.po +10 -1
  19. odoo/addons/account_financial_report/i18n/pt_BR.po +10 -1
  20. odoo/addons/account_financial_report/i18n/ro.po +10 -1
  21. odoo/addons/account_financial_report/i18n/sv.po +10 -1
  22. odoo/addons/account_financial_report/i18n/tr.po +10 -1
  23. odoo/addons/account_financial_report/report/general_ledger.py +4 -3
  24. odoo/addons/account_financial_report/report/general_ledger_xlsx.py +12 -10
  25. odoo/addons/account_financial_report/report/journal_ledger.py +30 -31
  26. odoo/addons/account_financial_report/report/templates/general_ledger.xml +40 -22
  27. odoo/addons/account_financial_report/report/templates/trial_balance.xml +2 -2
  28. odoo/addons/account_financial_report/report/trial_balance.py +20 -1
  29. odoo/addons/account_financial_report/static/description/index.html +22 -16
  30. {odoo_addon_account_financial_report-17.0.1.6.2.dist-info → odoo_addon_account_financial_report-17.0.1.6.10.dist-info}/METADATA +7 -3
  31. {odoo_addon_account_financial_report-17.0.1.6.2.dist-info → odoo_addon_account_financial_report-17.0.1.6.10.dist-info}/RECORD +33 -34
  32. odoo/addons/account_financial_report/i18n/fr_FR.po +0 -2094
  33. {odoo_addon_account_financial_report-17.0.1.6.2.dist-info → odoo_addon_account_financial_report-17.0.1.6.10.dist-info}/WHEEL +0 -0
  34. {odoo_addon_account_financial_report-17.0.1.6.2.dist-info → odoo_addon_account_financial_report-17.0.1.6.10.dist-info}/top_level.txt +0 -0
@@ -1054,7 +1054,7 @@ msgstr "Po??etni saldo"
1054
1054
 
1055
1055
  #. module: account_financial_report
1056
1056
  #: model:ir.model.fields,field_description:account_financial_report.field_aged_partner_balance_report_wizard__age_partner_config_id
1057
- #: model:ir.model.fields,field_description:account_financial_report.field_res_config_settings__default_age_partner_config_id
1057
+ #: model:ir.model.fields,field_description:account_financial_report.field_res_config_settings__age_partner_config_id
1058
1058
  msgid "Intervals configuration"
1059
1059
  msgstr ""
1060
1060
 
@@ -1743,6 +1743,15 @@ msgstr ""
1743
1743
  msgid "The hierarchy level to filter on must be greater than 0."
1744
1744
  msgstr "Razina strukture za filtriranje mora biti ve??a od 0."
1745
1745
 
1746
+ #. module: account_financial_report
1747
+ #. odoo-python
1748
+ #: code:addons/account_financial_report/report/trial_balance.py:0
1749
+ #, python-format
1750
+ msgid ""
1751
+ "There is a problem in the structure of the account groups. You may need to "
1752
+ "create some child group of %s."
1753
+ msgstr ""
1754
+
1746
1755
  #. module: account_financial_report
1747
1756
  #: model:ir.model.fields,help:account_financial_report.field_general_ledger_report_wizard__domain
1748
1757
  msgid "This domain will be used to select specific domain for Journal Items"
@@ -1051,7 +1051,7 @@ msgstr ""
1051
1051
 
1052
1052
  #. module: account_financial_report
1053
1053
  #: model:ir.model.fields,field_description:account_financial_report.field_aged_partner_balance_report_wizard__age_partner_config_id
1054
- #: model:ir.model.fields,field_description:account_financial_report.field_res_config_settings__default_age_partner_config_id
1054
+ #: model:ir.model.fields,field_description:account_financial_report.field_res_config_settings__age_partner_config_id
1055
1055
  msgid "Intervals configuration"
1056
1056
  msgstr ""
1057
1057
 
@@ -1740,6 +1740,15 @@ msgstr ""
1740
1740
  msgid "The hierarchy level to filter on must be greater than 0."
1741
1741
  msgstr ""
1742
1742
 
1743
+ #. module: account_financial_report
1744
+ #. odoo-python
1745
+ #: code:addons/account_financial_report/report/trial_balance.py:0
1746
+ #, python-format
1747
+ msgid ""
1748
+ "There is a problem in the structure of the account groups. You may need to "
1749
+ "create some child group of %s."
1750
+ msgstr ""
1751
+
1743
1752
  #. module: account_financial_report
1744
1753
  #: model:ir.model.fields,help:account_financial_report.field_general_ledger_report_wizard__domain
1745
1754
  msgid "This domain will be used to select specific domain for Journal Items"
@@ -7,7 +7,7 @@ msgstr ""
7
7
  "Project-Id-Version: Odoo Server 12.0\n"
8
8
  "Report-Msgid-Bugs-To: \n"
9
9
  "POT-Creation-Date: 2019-06-03 12:07+0000\n"
10
- "PO-Revision-Date: 2024-12-04 11:06+0000\n"
10
+ "PO-Revision-Date: 2025-05-14 09:23+0000\n"
11
11
  "Last-Translator: mymage <stefano.consolaro@mymage.it>\n"
12
12
  "Language-Team: \n"
13
13
  "Language: it\n"
@@ -15,7 +15,7 @@ msgstr ""
15
15
  "Content-Type: text/plain; charset=UTF-8\n"
16
16
  "Content-Transfer-Encoding: 8bit\n"
17
17
  "Plural-Forms: nplurals=2; plural=n != 1;\n"
18
- "X-Generator: Weblate 5.6.2\n"
18
+ "X-Generator: Weblate 5.10.4\n"
19
19
 
20
20
  #. module: account_financial_report
21
21
  #: model_terms:ir.ui.view,arch_db:account_financial_report.report_aged_partner_balance_lines_header
@@ -1074,7 +1074,7 @@ msgstr "Saldo iniziale"
1074
1074
 
1075
1075
  #. module: account_financial_report
1076
1076
  #: model:ir.model.fields,field_description:account_financial_report.field_aged_partner_balance_report_wizard__age_partner_config_id
1077
- #: model:ir.model.fields,field_description:account_financial_report.field_res_config_settings__default_age_partner_config_id
1077
+ #: model:ir.model.fields,field_description:account_financial_report.field_res_config_settings__age_partner_config_id
1078
1078
  msgid "Intervals configuration"
1079
1079
  msgstr "Configurazione intervalli"
1080
1080
 
@@ -1776,6 +1776,17 @@ msgstr ""
1776
1776
  msgid "The hierarchy level to filter on must be greater than 0."
1777
1777
  msgstr "Il livello gerarchico da filtrare deve essere maggiore di 0."
1778
1778
 
1779
+ #. module: account_financial_report
1780
+ #. odoo-python
1781
+ #: code:addons/account_financial_report/report/trial_balance.py:0
1782
+ #, python-format
1783
+ msgid ""
1784
+ "There is a problem in the structure of the account groups. You may need to "
1785
+ "create some child group of %s."
1786
+ msgstr ""
1787
+ "C'è un problema nella struttura dei gruppi contabilità. Serve creare alcuni "
1788
+ "figli del gruppo %s."
1789
+
1779
1790
  #. module: account_financial_report
1780
1791
  #: model:ir.model.fields,help:account_financial_report.field_general_ledger_report_wizard__domain
1781
1792
  msgid "This domain will be used to select specific domain for Journal Items"
@@ -1044,7 +1044,7 @@ msgstr ""
1044
1044
 
1045
1045
  #. module: account_financial_report
1046
1046
  #: model:ir.model.fields,field_description:account_financial_report.field_aged_partner_balance_report_wizard__age_partner_config_id
1047
- #: model:ir.model.fields,field_description:account_financial_report.field_res_config_settings__default_age_partner_config_id
1047
+ #: model:ir.model.fields,field_description:account_financial_report.field_res_config_settings__age_partner_config_id
1048
1048
  msgid "Intervals configuration"
1049
1049
  msgstr ""
1050
1050
 
@@ -1733,6 +1733,15 @@ msgstr ""
1733
1733
  msgid "The hierarchy level to filter on must be greater than 0."
1734
1734
  msgstr ""
1735
1735
 
1736
+ #. module: account_financial_report
1737
+ #. odoo-python
1738
+ #: code:addons/account_financial_report/report/trial_balance.py:0
1739
+ #, python-format
1740
+ msgid ""
1741
+ "There is a problem in the structure of the account groups. You may need to "
1742
+ "create some child group of %s."
1743
+ msgstr ""
1744
+
1736
1745
  #. module: account_financial_report
1737
1746
  #: model:ir.model.fields,help:account_financial_report.field_general_ledger_report_wizard__domain
1738
1747
  msgid "This domain will be used to select specific domain for Journal Items"
@@ -1062,7 +1062,7 @@ msgstr "Beginbalans"
1062
1062
 
1063
1063
  #. module: account_financial_report
1064
1064
  #: model:ir.model.fields,field_description:account_financial_report.field_aged_partner_balance_report_wizard__age_partner_config_id
1065
- #: model:ir.model.fields,field_description:account_financial_report.field_res_config_settings__default_age_partner_config_id
1065
+ #: model:ir.model.fields,field_description:account_financial_report.field_res_config_settings__age_partner_config_id
1066
1066
  msgid "Intervals configuration"
1067
1067
  msgstr ""
1068
1068
 
@@ -1763,6 +1763,15 @@ msgid "The hierarchy level to filter on must be greater than 0."
1763
1763
  msgstr ""
1764
1764
  "Het hi??rarchieniveau waarop gefilterd moet worden, moet groter zijn dan 0."
1765
1765
 
1766
+ #. module: account_financial_report
1767
+ #. odoo-python
1768
+ #: code:addons/account_financial_report/report/trial_balance.py:0
1769
+ #, python-format
1770
+ msgid ""
1771
+ "There is a problem in the structure of the account groups. You may need to "
1772
+ "create some child group of %s."
1773
+ msgstr ""
1774
+
1766
1775
  #. module: account_financial_report
1767
1776
  #: model:ir.model.fields,help:account_financial_report.field_general_ledger_report_wizard__domain
1768
1777
  msgid "This domain will be used to select specific domain for Journal Items"
@@ -1050,7 +1050,7 @@ msgstr ""
1050
1050
 
1051
1051
  #. module: account_financial_report
1052
1052
  #: model:ir.model.fields,field_description:account_financial_report.field_aged_partner_balance_report_wizard__age_partner_config_id
1053
- #: model:ir.model.fields,field_description:account_financial_report.field_res_config_settings__default_age_partner_config_id
1053
+ #: model:ir.model.fields,field_description:account_financial_report.field_res_config_settings__age_partner_config_id
1054
1054
  msgid "Intervals configuration"
1055
1055
  msgstr ""
1056
1056
 
@@ -1739,6 +1739,15 @@ msgstr ""
1739
1739
  msgid "The hierarchy level to filter on must be greater than 0."
1740
1740
  msgstr ""
1741
1741
 
1742
+ #. module: account_financial_report
1743
+ #. odoo-python
1744
+ #: code:addons/account_financial_report/report/trial_balance.py:0
1745
+ #, python-format
1746
+ msgid ""
1747
+ "There is a problem in the structure of the account groups. You may need to "
1748
+ "create some child group of %s."
1749
+ msgstr ""
1750
+
1742
1751
  #. module: account_financial_report
1743
1752
  #: model:ir.model.fields,help:account_financial_report.field_general_ledger_report_wizard__domain
1744
1753
  msgid "This domain will be used to select specific domain for Journal Items"
@@ -1062,7 +1062,7 @@ msgstr "Saldo Inicial"
1062
1062
 
1063
1063
  #. module: account_financial_report
1064
1064
  #: model:ir.model.fields,field_description:account_financial_report.field_aged_partner_balance_report_wizard__age_partner_config_id
1065
- #: model:ir.model.fields,field_description:account_financial_report.field_res_config_settings__default_age_partner_config_id
1065
+ #: model:ir.model.fields,field_description:account_financial_report.field_res_config_settings__age_partner_config_id
1066
1066
  msgid "Intervals configuration"
1067
1067
  msgstr "Configuração de intervalos"
1068
1068
 
@@ -1762,6 +1762,15 @@ msgstr ""
1762
1762
  msgid "The hierarchy level to filter on must be greater than 0."
1763
1763
  msgstr "O nível hierárquico a filtrar deve ser superior a 0."
1764
1764
 
1765
+ #. module: account_financial_report
1766
+ #. odoo-python
1767
+ #: code:addons/account_financial_report/report/trial_balance.py:0
1768
+ #, python-format
1769
+ msgid ""
1770
+ "There is a problem in the structure of the account groups. You may need to "
1771
+ "create some child group of %s."
1772
+ msgstr ""
1773
+
1765
1774
  #. module: account_financial_report
1766
1775
  #: model:ir.model.fields,help:account_financial_report.field_general_ledger_report_wizard__domain
1767
1776
  msgid "This domain will be used to select specific domain for Journal Items"
@@ -1059,7 +1059,7 @@ msgstr "Saldo inicial"
1059
1059
 
1060
1060
  #. module: account_financial_report
1061
1061
  #: model:ir.model.fields,field_description:account_financial_report.field_aged_partner_balance_report_wizard__age_partner_config_id
1062
- #: model:ir.model.fields,field_description:account_financial_report.field_res_config_settings__default_age_partner_config_id
1062
+ #: model:ir.model.fields,field_description:account_financial_report.field_res_config_settings__age_partner_config_id
1063
1063
  msgid "Intervals configuration"
1064
1064
  msgstr ""
1065
1065
 
@@ -1760,6 +1760,15 @@ msgstr ""
1760
1760
  msgid "The hierarchy level to filter on must be greater than 0."
1761
1761
  msgstr "O filtro de n??vel hier??rquico deve ser maior que zero."
1762
1762
 
1763
+ #. module: account_financial_report
1764
+ #. odoo-python
1765
+ #: code:addons/account_financial_report/report/trial_balance.py:0
1766
+ #, python-format
1767
+ msgid ""
1768
+ "There is a problem in the structure of the account groups. You may need to "
1769
+ "create some child group of %s."
1770
+ msgstr ""
1771
+
1763
1772
  #. module: account_financial_report
1764
1773
  #: model:ir.model.fields,help:account_financial_report.field_general_ledger_report_wizard__domain
1765
1774
  msgid "This domain will be used to select specific domain for Journal Items"
@@ -1056,7 +1056,7 @@ msgstr "Sold ini??ial"
1056
1056
 
1057
1057
  #. module: account_financial_report
1058
1058
  #: model:ir.model.fields,field_description:account_financial_report.field_aged_partner_balance_report_wizard__age_partner_config_id
1059
- #: model:ir.model.fields,field_description:account_financial_report.field_res_config_settings__default_age_partner_config_id
1059
+ #: model:ir.model.fields,field_description:account_financial_report.field_res_config_settings__age_partner_config_id
1060
1060
  msgid "Intervals configuration"
1061
1061
  msgstr ""
1062
1062
 
@@ -1748,6 +1748,15 @@ msgstr ""
1748
1748
  msgid "The hierarchy level to filter on must be greater than 0."
1749
1749
  msgstr "Nivelul de ierarhie de filtrat trebuie s?? fie mai mare de 0."
1750
1750
 
1751
+ #. module: account_financial_report
1752
+ #. odoo-python
1753
+ #: code:addons/account_financial_report/report/trial_balance.py:0
1754
+ #, python-format
1755
+ msgid ""
1756
+ "There is a problem in the structure of the account groups. You may need to "
1757
+ "create some child group of %s."
1758
+ msgstr ""
1759
+
1751
1760
  #. module: account_financial_report
1752
1761
  #: model:ir.model.fields,help:account_financial_report.field_general_ledger_report_wizard__domain
1753
1762
  msgid "This domain will be used to select specific domain for Journal Items"
@@ -1068,7 +1068,7 @@ msgstr "Initial balans"
1068
1068
 
1069
1069
  #. module: account_financial_report
1070
1070
  #: model:ir.model.fields,field_description:account_financial_report.field_aged_partner_balance_report_wizard__age_partner_config_id
1071
- #: model:ir.model.fields,field_description:account_financial_report.field_res_config_settings__default_age_partner_config_id
1071
+ #: model:ir.model.fields,field_description:account_financial_report.field_res_config_settings__age_partner_config_id
1072
1072
  msgid "Intervals configuration"
1073
1073
  msgstr "Konfiguration av intervall"
1074
1074
 
@@ -1768,6 +1768,15 @@ msgstr ""
1768
1768
  msgid "The hierarchy level to filter on must be greater than 0."
1769
1769
  msgstr "Hierarkinivån att filtrera på måste vara större än 0."
1770
1770
 
1771
+ #. module: account_financial_report
1772
+ #. odoo-python
1773
+ #: code:addons/account_financial_report/report/trial_balance.py:0
1774
+ #, python-format
1775
+ msgid ""
1776
+ "There is a problem in the structure of the account groups. You may need to "
1777
+ "create some child group of %s."
1778
+ msgstr ""
1779
+
1771
1780
  #. module: account_financial_report
1772
1781
  #: model:ir.model.fields,help:account_financial_report.field_general_ledger_report_wizard__domain
1773
1782
  msgid "This domain will be used to select specific domain for Journal Items"
@@ -1054,7 +1054,7 @@ msgstr "Açılış Bakiyesi"
1054
1054
 
1055
1055
  #. module: account_financial_report
1056
1056
  #: model:ir.model.fields,field_description:account_financial_report.field_aged_partner_balance_report_wizard__age_partner_config_id
1057
- #: model:ir.model.fields,field_description:account_financial_report.field_res_config_settings__default_age_partner_config_id
1057
+ #: model:ir.model.fields,field_description:account_financial_report.field_res_config_settings__age_partner_config_id
1058
1058
  msgid "Intervals configuration"
1059
1059
  msgstr ""
1060
1060
 
@@ -1747,6 +1747,15 @@ msgstr ""
1747
1747
  msgid "The hierarchy level to filter on must be greater than 0."
1748
1748
  msgstr ""
1749
1749
 
1750
+ #. module: account_financial_report
1751
+ #. odoo-python
1752
+ #: code:addons/account_financial_report/report/trial_balance.py:0
1753
+ #, python-format
1754
+ msgid ""
1755
+ "There is a problem in the structure of the account groups. You may need to "
1756
+ "create some child group of %s."
1757
+ msgstr ""
1758
+
1750
1759
  #. module: account_financial_report
1751
1760
  #: model:ir.model.fields,help:account_financial_report.field_general_ledger_report_wizard__domain
1752
1761
  msgid "This domain will be used to select specific domain for Journal Items"
@@ -20,7 +20,8 @@ class GeneralLedgerReport(models.AbstractModel):
20
20
  analytic_accounts = self.env["account.analytic.account"].browse(account_ids)
21
21
  analytic_data = {}
22
22
  for account in analytic_accounts:
23
- analytic_data.update({account.id: {"name": account.name}})
23
+ name = f"[{account.code}] {account.name}" if account.code else account.name
24
+ analytic_data.update({account.id: {"name": name}})
24
25
  return analytic_data
25
26
 
26
27
  def _get_taxes_data(self, taxes_ids):
@@ -470,8 +471,8 @@ class GeneralLedgerReport(models.AbstractModel):
470
471
  journal_ids.add(move_line["journal_id"][0])
471
472
  for tax_id in move_line["tax_ids"]:
472
473
  taxes_ids.add(tax_id)
473
- for analytic_account in move_line["analytic_distribution"] or {}:
474
- analytic_ids.add(int(analytic_account))
474
+ for ids in (move_line["analytic_distribution"] or {}).keys():
475
+ analytic_ids.update(map(int, ids.split(",")))
475
476
  if move_line["full_reconcile_id"]:
476
477
  rec_id = move_line["full_reconcile_id"][0]
477
478
  if rec_id not in full_reconcile_ids:
@@ -195,16 +195,18 @@ class GeneralLedgerXslx(models.AbstractModel):
195
195
  taxes_description += taxes_data[tax_id]["tax_name"] + " "
196
196
  if line["tax_line_id"]:
197
197
  taxes_description += line["tax_line_id"][1]
198
- for account_id, value in line["analytic_distribution"].items():
199
- if value < 100:
200
- analytic_distribution += "%s %d%% " % (
201
- analytic_data[int(account_id)]["name"],
202
- value,
203
- )
204
- else:
205
- analytic_distribution += (
206
- "%s " % analytic_data[int(account_id)]["name"]
207
- )
198
+ analytic_list = []
199
+ for account_ids, percentage in line[
200
+ "analytic_distribution"
201
+ ].items():
202
+ for account_id in account_ids.split(","):
203
+ name = analytic_data[int(account_id)]["name"]
204
+ if percentage < 100:
205
+ analytic_list.append(f"{name} {int(percentage)}%")
206
+ else:
207
+ analytic_list.append(name)
208
+ analytic_distribution = ", ".join(analytic_list)
209
+
208
210
  line.update(
209
211
  {
210
212
  "taxes_description": taxes_description,
@@ -3,6 +3,7 @@
3
3
 
4
4
  import itertools
5
5
  import operator
6
+ from collections import defaultdict
6
7
 
7
8
  from odoo import models
8
9
 
@@ -181,13 +182,23 @@ class JournalLedgerReport(models.AbstractModel):
181
182
  return {"move_line_ids": tuple(move_lines.ids)}
182
183
 
183
184
  def _get_move_lines(self, move_ids, wizard, journal_ids):
184
- move_lines = self.env["account.move.line"].search(
185
- self._get_move_lines_domain(move_ids, wizard, journal_ids),
186
- order=self._get_move_lines_order(move_ids, wizard, journal_ids),
185
+ move_lines = (
186
+ self.env["account.move.line"]
187
+ .with_context(prefetch_fields=False)
188
+ .search(
189
+ self._get_move_lines_domain(move_ids, wizard, journal_ids),
190
+ order=self._get_move_lines_order(move_ids, wizard, journal_ids),
191
+ )
187
192
  )
188
- move_lines_exigible = self.env["account.move.line"].search(
189
- self._get_move_lines_domain(move_ids, wizard, journal_ids)
190
- + self.env["account.move.line"]._get_tax_exigible_domain(),
193
+ # Get the exigible move lines ids instead of the recordset to increase
194
+ # performance with a large number of journal items
195
+ move_lines_exigible_ids = set(
196
+ self.env["account.move.line"]
197
+ .search(
198
+ self._get_move_lines_domain(move_ids, wizard, journal_ids)
199
+ + self.env["account.move.line"]._get_tax_exigible_domain(),
200
+ )
201
+ .ids
191
202
  )
192
203
  move_line_ids_taxes_data = {}
193
204
  if move_lines:
@@ -209,36 +220,24 @@ class JournalLedgerReport(models.AbstractModel):
209
220
  "description": tax_description,
210
221
  }
211
222
  Move_Lines = {}
212
- accounts = self.env["account.account"]
213
- partners = self.env["res.partner"]
214
- currencies = self.env["res.currency"]
215
- tax_lines = self.env["account.tax"]
216
223
  auto_sequence = len(move_ids)
224
+ Move_Lines = defaultdict(list)
217
225
  for ml in move_lines:
218
- if ml.account_id not in accounts:
219
- accounts |= ml.account_id
220
- if ml.partner_id not in partners:
221
- partners |= ml.partner_id
222
- if ml.currency_id not in currencies:
223
- currencies |= ml.currency_id
224
- if ml.tax_line_id not in tax_lines:
225
- tax_lines |= ml.tax_line_id
226
- if ml.move_id.id not in Move_Lines.keys():
227
- Move_Lines[ml.move_id.id] = []
226
+ move_id = ml.move_id.id
227
+ if move_id not in Move_Lines:
228
228
  auto_sequence -= 1
229
- taxes = (
230
- ml.id in move_line_ids_taxes_data.keys()
231
- and move_line_ids_taxes_data[ml.id]
232
- or {}
233
- )
234
- exigible = ml in move_lines_exigible
235
- Move_Lines[ml.move_id.id].append(
229
+ taxes = move_line_ids_taxes_data.get(ml.id, {})
230
+ # Check the exigibility of the move line by id
231
+ # this way we avoid the recreation of the recordset which affects to the
232
+ # performance in the case of a large number of journal items
233
+ exigible = ml.id in move_lines_exigible_ids
234
+ Move_Lines[move_id].append(
236
235
  self._get_move_lines_data(ml, wizard, taxes, auto_sequence, exigible)
237
236
  )
238
- account_ids_data = self._get_account_data(accounts)
239
- partner_ids_data = self._get_partner_data(partners)
240
- currency_ids_data = self._get_currency_data(currencies)
241
- tax_line_ids_data = self._get_tax_line_data(tax_lines)
237
+ account_ids_data = self._get_account_data(move_lines.account_id)
238
+ partner_ids_data = self._get_partner_data(move_lines.partner_id)
239
+ currency_ids_data = self._get_currency_data(move_lines.currency_id)
240
+ tax_line_ids_data = self._get_tax_line_data(move_lines.tax_line_id)
242
241
  return (
243
242
  move_lines.ids,
244
243
  Move_Lines,
@@ -475,29 +475,47 @@
475
475
  <!--## cost_center-->
476
476
  <t t-if="show_cost_center">
477
477
  <div class="act_as_cell left">
478
- <t
479
- t-foreach="line['analytic_distribution']"
480
- t-as="analytic_id"
481
- >
482
- <div>
483
- <span
484
- t-att-res-id="analytic_id"
485
- res-model="account.analytic.account"
486
- view-type="form"
478
+ <ul style="list-style: none; padding: 0; margin: 0;">
479
+ <t
480
+ t-foreach="line['analytic_distribution'].items()"
481
+ t-as="analytic_entry"
482
+ >
483
+ <t
484
+ t-set="analytic_ids"
485
+ t-value="analytic_entry[0]"
486
+ />
487
+ <t t-set="percentage" t-value="analytic_entry[1]" />
488
+ <t
489
+ t-foreach="analytic_ids.split(',')"
490
+ t-as="analytic_id"
487
491
  >
488
- <t
489
- t-out="o._get_atr_from_dict(int(analytic_id), analytic_data, 'name')"
490
- />
491
- <t
492
- t-if="int(line['analytic_distribution'][analytic_id]) &lt; 100"
493
- >
494
- <t
495
- t-out="int(line['analytic_distribution'][analytic_id])"
496
- />%
497
- </t>
498
- </span>
499
- </div>
500
- </t>
492
+ <li style="padding: 2px 0;">
493
+ <span
494
+ t-att-res-id="analytic_id"
495
+ res-model="account.analytic.account"
496
+ view-type="form"
497
+ >
498
+ <t
499
+ t-set="analytic_id"
500
+ t-value="analytic_id.strip()"
501
+ />
502
+ <t
503
+ t-set="account_name"
504
+ t-value="o._get_atr_from_dict(int(analytic_id), analytic_data, 'name')"
505
+ />
506
+ <t t-if="percentage &lt; 100">
507
+ <t
508
+ t-out="account_name + ' (' + str(percentage) + '%)'"
509
+ />
510
+ </t>
511
+ <t t-else="">
512
+ <t t-out="account_name" />
513
+ </t>
514
+ </span>
515
+ </li>
516
+ </t>
517
+ </t>
518
+ </ul>
501
519
  </div>
502
520
  </t>
503
521
  <t t-if="show_analytic_tags">
@@ -52,12 +52,12 @@
52
52
  <t
53
53
  t-set="aml_domain_extra"
54
54
  t-if="grouped_item['id'] > 0"
55
- t-value="[('analytic_account_id', '=', grouped_item['id'])]"
55
+ t-value="[('analytic_account_ids', '=', grouped_item['id'])]"
56
56
  />
57
57
  <t
58
58
  t-set="aml_domain_extra"
59
59
  t-else=""
60
- t-value="[('analytic_account_id', '=', False)]"
60
+ t-value="[('analytic_account_ids', '=', False)]"
61
61
  />
62
62
  <div class="act_as_table data_table" style="width: 100%;">
63
63
  <t
@@ -5,6 +5,7 @@
5
5
 
6
6
 
7
7
  from odoo import _, api, models
8
+ from odoo.exceptions import UserError
8
9
  from odoo.tools.float_utils import float_is_zero
9
10
 
10
11
 
@@ -687,8 +688,26 @@ class TrialBalanceReport(models.AbstractModel):
687
688
  return trial_balance, total_amount_grouped
688
689
 
689
690
  def _get_hierarchy_groups(self, group_ids, groups_data, foreign_currency):
690
- for group_id in group_ids:
691
+ processed_groups = []
692
+ # Sort groups so that parent groups are processed before child groups
693
+ groups = (
694
+ self.env["account.group"]
695
+ .browse(group_ids)
696
+ .sorted(key=lambda x: x.complete_code)
697
+ )
698
+ for group in groups:
699
+ group_id = group.id
691
700
  parent_id = groups_data[group_id]["parent_id"]
701
+ if group_id in processed_groups:
702
+ raise UserError(
703
+ _(
704
+ "There is a problem in the structure of the account groups. "
705
+ "You may need to create some child group of %s."
706
+ )
707
+ % groups_data[group_id]["name"]
708
+ )
709
+ else:
710
+ processed_groups.append(parent_id)
692
711
  while parent_id:
693
712
  if parent_id not in groups_data.keys():
694
713
  group = self.env["account.group"].browse(parent_id)