odoo-addon-account-financial-report 17.0.1.6.1.1__py3-none-any.whl → 18.0.1.0.0.3__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.
- odoo/addons/account_financial_report/README.rst +15 -8
- odoo/addons/account_financial_report/__manifest__.py +3 -2
- odoo/addons/account_financial_report/i18n/account_financial_report.pot +1 -124
- odoo/addons/account_financial_report/i18n/ar.po +3 -100
- odoo/addons/account_financial_report/i18n/ca.po +1 -100
- odoo/addons/account_financial_report/i18n/de.po +3 -100
- odoo/addons/account_financial_report/i18n/es.po +0 -100
- odoo/addons/account_financial_report/i18n/es_AR.po +0 -100
- odoo/addons/account_financial_report/i18n/es_MX.po +0 -100
- odoo/addons/account_financial_report/i18n/fr.po +0 -100
- odoo/addons/account_financial_report/i18n/fr_CH.po +1 -100
- odoo/addons/account_financial_report/i18n/fr_FR.po +0 -100
- odoo/addons/account_financial_report/i18n/hr.po +0 -100
- odoo/addons/account_financial_report/i18n/hr_HR.po +3 -100
- odoo/addons/account_financial_report/i18n/it.po +3 -107
- odoo/addons/account_financial_report/i18n/ja.po +3 -100
- odoo/addons/account_financial_report/i18n/nl.po +1 -100
- odoo/addons/account_financial_report/i18n/nl_NL.po +2 -100
- odoo/addons/account_financial_report/i18n/pt.po +0 -100
- odoo/addons/account_financial_report/i18n/pt_BR.po +0 -100
- odoo/addons/account_financial_report/i18n/ro.po +1 -100
- odoo/addons/account_financial_report/i18n/sv.po +0 -100
- odoo/addons/account_financial_report/i18n/tr.po +0 -100
- odoo/addons/account_financial_report/models/account.py +1 -1
- odoo/addons/account_financial_report/models/account_age_report_configuration.py +6 -4
- odoo/addons/account_financial_report/models/account_group.py +3 -3
- odoo/addons/account_financial_report/readme/CONFIGURE.md +1 -1
- odoo/addons/account_financial_report/readme/CONTRIBUTORS.md +2 -1
- odoo/addons/account_financial_report/readme/CREDITS.md +1 -0
- odoo/addons/account_financial_report/report/__init__.py +3 -3
- odoo/addons/account_financial_report/report/abstract_report.py +3 -1
- odoo/addons/account_financial_report/report/abstract_report_xlsx.py +5 -5
- odoo/addons/account_financial_report/report/aged_partner_balance.py +16 -20
- odoo/addons/account_financial_report/report/aged_partner_balance_xlsx.py +30 -30
- odoo/addons/account_financial_report/report/general_ledger.py +26 -14
- odoo/addons/account_financial_report/report/general_ledger_xlsx.py +3 -3
- odoo/addons/account_financial_report/report/journal_ledger.py +9 -9
- odoo/addons/account_financial_report/report/journal_ledger_xlsx.py +1 -1
- odoo/addons/account_financial_report/report/open_items.py +1 -1
- odoo/addons/account_financial_report/report/open_items_xlsx.py +1 -1
- odoo/addons/account_financial_report/report/templates/aged_partner_balance.xml +29 -27
- odoo/addons/account_financial_report/report/templates/general_ledger.xml +2 -2
- odoo/addons/account_financial_report/report/templates/journal_ledger.xml +58 -66
- odoo/addons/account_financial_report/report/templates/layouts.xml +3 -9
- odoo/addons/account_financial_report/report/templates/trial_balance.xml +3 -5
- odoo/addons/account_financial_report/report/trial_balance.py +27 -30
- odoo/addons/account_financial_report/report/trial_balance_xlsx.py +1 -1
- odoo/addons/account_financial_report/report/vat_report.py +8 -4
- odoo/addons/account_financial_report/report/vat_report_xlsx.py +1 -1
- odoo/addons/account_financial_report/static/description/index.html +15 -8
- odoo/addons/account_financial_report/static/src/js/report.esm.js +1 -2
- odoo/addons/account_financial_report/static/src/js/report_action.esm.js +0 -1
- odoo/addons/account_financial_report/static/src/{css/report.css → scss/report.scss} +74 -42
- odoo/addons/account_financial_report/static/src/scss/report_html.scss +10 -0
- odoo/addons/account_financial_report/tests/__init__.py +1 -1
- odoo/addons/account_financial_report/tests/test_general_ledger.py +3 -3
- odoo/addons/account_financial_report/tests/test_journal_ledger.py +3 -4
- odoo/addons/account_financial_report/tests/test_open_items.py +2 -2
- odoo/addons/account_financial_report/tests/test_trial_balance.py +15 -8
- odoo/addons/account_financial_report/tests/test_vat_report.py +4 -5
- odoo/addons/account_financial_report/view/account_age_report_configuration_views.xml +6 -6
- odoo/addons/account_financial_report/wizard/aged_partner_balance_wizard.py +6 -4
- odoo/addons/account_financial_report/wizard/general_ledger_wizard.py +5 -5
- odoo/addons/account_financial_report/wizard/general_ledger_wizard_view.xml +14 -14
- odoo/addons/account_financial_report/wizard/journal_ledger_wizard.py +8 -4
- odoo/addons/account_financial_report/wizard/journal_ledger_wizard_view.xml +14 -14
- odoo/addons/account_financial_report/wizard/open_items_wizard.py +1 -1
- odoo/addons/account_financial_report/wizard/open_items_wizard_view.xml +14 -14
- odoo/addons/account_financial_report/wizard/trial_balance_wizard.py +10 -8
- odoo/addons/account_financial_report/wizard/trial_balance_wizard_view.xml +14 -14
- odoo/addons/account_financial_report/wizard/vat_report_wizard.py +2 -2
- odoo/addons/account_financial_report/wizard/vat_report_wizard_view.xml +14 -14
- {odoo_addon_account_financial_report-17.0.1.6.1.1.dist-info → odoo_addon_account_financial_report-18.0.1.0.0.3.dist-info}/METADATA +20 -13
- {odoo_addon_account_financial_report-17.0.1.6.1.1.dist-info → odoo_addon_account_financial_report-18.0.1.0.0.3.dist-info}/RECORD +76 -75
- odoo/addons/account_financial_report/static/src/css/report_html.css +0 -7
- {odoo_addon_account_financial_report-17.0.1.6.1.1.dist-info → odoo_addon_account_financial_report-18.0.1.0.0.3.dist-info}/WHEEL +0 -0
- {odoo_addon_account_financial_report-17.0.1.6.1.1.dist-info → odoo_addon_account_financial_report-18.0.1.0.0.3.dist-info}/top_level.txt +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Copyright 2023 Ernesto García
|
|
2
2
|
# Copyright 2023 Carolina Fernandez
|
|
3
3
|
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
|
|
4
|
-
from odoo import
|
|
4
|
+
from odoo import api, fields, models
|
|
5
5
|
from odoo.exceptions import ValidationError
|
|
6
6
|
|
|
7
7
|
|
|
@@ -21,7 +21,7 @@ class AccountAgeReportConfiguration(models.Model):
|
|
|
21
21
|
def _check_line_ids(self):
|
|
22
22
|
for rec in self:
|
|
23
23
|
if not rec.line_ids:
|
|
24
|
-
raise ValidationError(_("Must complete Configuration Lines"))
|
|
24
|
+
raise ValidationError(self.env._("Must complete Configuration Lines"))
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
class AccountAgeReportConfigurationLine(models.Model):
|
|
@@ -36,12 +36,14 @@ class AccountAgeReportConfigurationLine(models.Model):
|
|
|
36
36
|
def _check_inferior_limit(self):
|
|
37
37
|
for rec in self:
|
|
38
38
|
if rec.inferior_limit <= 0:
|
|
39
|
-
raise ValidationError(
|
|
39
|
+
raise ValidationError(
|
|
40
|
+
self.env._("Inferior Limit must be greather than zero")
|
|
41
|
+
)
|
|
40
42
|
|
|
41
43
|
_sql_constraints = [
|
|
42
44
|
(
|
|
43
45
|
"unique_name_config_combination",
|
|
44
46
|
"UNIQUE(name,account_age_report_config_id)",
|
|
45
|
-
|
|
47
|
+
"Name must be unique per report configuration",
|
|
46
48
|
)
|
|
47
49
|
]
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# © 2018 Forest and Biomass Romania SA
|
|
2
2
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
|
3
3
|
|
|
4
4
|
from odoo import api, fields, models
|
|
@@ -42,8 +42,8 @@ class AccountGroup(models.Model):
|
|
|
42
42
|
"""Forms complete code of location from parent location to child location."""
|
|
43
43
|
for group in self:
|
|
44
44
|
if group.parent_id.complete_code:
|
|
45
|
-
group.complete_code =
|
|
46
|
-
group.parent_id.complete_code
|
|
45
|
+
group.complete_code = (
|
|
46
|
+
f"{group.parent_id.complete_code}/{group.code_prefix_start}"
|
|
47
47
|
)
|
|
48
48
|
else:
|
|
49
49
|
group.complete_code = group.code_prefix_start
|
|
@@ -16,7 +16,7 @@ Example of configuration inferior limit:
|
|
|
16
16
|
|
|
17
17
|
It means the first interval is from 0 to 15, the second from 16 to 30, and the third is 61+.
|
|
18
18
|
|
|
19
|
-
Go on 'Invoicing' -> '
|
|
19
|
+
Go on 'Invoicing' -> 'Reporting' -> 'OCA accounting reports' -> 'Aged Partner Balance'
|
|
20
20
|
|
|
21
21
|
When wizard is open, you need to select your interval configuration and print report.
|
|
22
22
|
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
- Pedro M. Baeza
|
|
21
21
|
- Sergio Teruel
|
|
22
22
|
- Ernesto Tejeda
|
|
23
|
-
-
|
|
23
|
+
- João Marques
|
|
24
24
|
- Alexandre D. D??az
|
|
25
25
|
- V??ctor Mart??nez
|
|
26
26
|
- Carolina Fernandez
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
- Lois Rilo \<<lois.rilo@forgeflow.com>\>
|
|
31
31
|
- Saran Lim. \<<saranl@ecosoft.co.th>\>
|
|
32
32
|
- Omar Casti??eira \<<omar@comunitea.com>\>
|
|
33
|
+
- Chau Le \<<chaulb@trobz.com>\>
|
|
33
34
|
|
|
34
35
|
Much of the work in this module was done at a sprint in Sorrento, Italy
|
|
35
36
|
in April 2016.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
The migration of this module from 17.0 to 18.0 was financially supported by Camptocamp.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
#
|
|
2
|
-
#
|
|
3
|
-
#
|
|
1
|
+
# © 2015 Yannick Vaucher (Camptocamp)
|
|
2
|
+
# © 2016 Damien Crier (Camptocamp)
|
|
3
|
+
# © 2016 Julien Coux (Camptocamp)
|
|
4
4
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).-
|
|
5
5
|
|
|
6
6
|
from . import abstract_report
|
|
@@ -143,7 +143,9 @@ class AgedPartnerBalanceReport(models.AbstractModel):
|
|
|
143
143
|
return accounts_data
|
|
144
144
|
|
|
145
145
|
def _get_journals_data(self, journals_ids):
|
|
146
|
-
journals = self.env["account.journal"].
|
|
146
|
+
journals = self.env["account.journal"].search_fetch(
|
|
147
|
+
[("id", "in", journals_ids)], ["code"]
|
|
148
|
+
)
|
|
147
149
|
journals_data = {}
|
|
148
150
|
for journal in journals:
|
|
149
151
|
journals_data.update({journal.id: {"id": journal.id, "code": journal.code}})
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Author: Julien Coux
|
|
2
2
|
# Copyright 2016 Camptocamp SA
|
|
3
|
-
# Copyright 2021 Tecnativa -
|
|
3
|
+
# Copyright 2021 Tecnativa - João Marques
|
|
4
4
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
|
5
5
|
from odoo import models
|
|
6
6
|
|
|
@@ -571,7 +571,7 @@ class AbstractReportXslx(models.AbstractModel):
|
|
|
571
571
|
"""Return amount header format for each currency."""
|
|
572
572
|
format_amt = report_data["formats"]["format_header_amount"]
|
|
573
573
|
if line_object.currency_id:
|
|
574
|
-
field_name = "format_header_amount_
|
|
574
|
+
field_name = f"format_header_amount_{line_object.currency_id.name}"
|
|
575
575
|
if hasattr(self, field_name):
|
|
576
576
|
format_amt = getattr(self, field_name)
|
|
577
577
|
else:
|
|
@@ -589,7 +589,7 @@ class AbstractReportXslx(models.AbstractModel):
|
|
|
589
589
|
"""Return amount header format for each currency."""
|
|
590
590
|
format_amt = report_data["formats"]["format_header_amount"]
|
|
591
591
|
if line_object["currency_id"]:
|
|
592
|
-
field_name = "format_header_amount_
|
|
592
|
+
field_name = f"format_header_amount_{line_object['currency_name']}"
|
|
593
593
|
if hasattr(self, field_name):
|
|
594
594
|
format_amt = getattr(self, field_name)
|
|
595
595
|
else:
|
|
@@ -610,8 +610,8 @@ class AbstractReportXslx(models.AbstractModel):
|
|
|
610
610
|
|
|
611
611
|
def _get_report_complete_name(self, report, prefix, data=None):
|
|
612
612
|
if report.company_id:
|
|
613
|
-
suffix =
|
|
614
|
-
report.company_id.name
|
|
613
|
+
suffix = (
|
|
614
|
+
f" - {report.company_id.name} - {report.company_id.currency_id.name}"
|
|
615
615
|
)
|
|
616
616
|
return prefix + suffix
|
|
617
617
|
return prefix
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# © 2016 Julien Coux (Camptocamp)
|
|
2
2
|
# Copyright 2020 ForgeFlow S.L. (https://www.forgeflow.com)
|
|
3
3
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
|
4
4
|
|
|
@@ -72,25 +72,21 @@ class AgedPartnerBalanceReport(models.AbstractModel):
|
|
|
72
72
|
else:
|
|
73
73
|
ag_pb_data[acc_id]["older"] += residual
|
|
74
74
|
ag_pb_data[acc_id][prt_id]["older"] += residual
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
next_line
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
):
|
|
91
|
-
ag_pb_data[acc_id][line] += residual
|
|
92
|
-
ag_pb_data[acc_id][prt_id][line] += residual
|
|
93
|
-
break
|
|
75
|
+
|
|
76
|
+
days_difference = abs((today - due_date).days)
|
|
77
|
+
for index, line in enumerate(interval_lines):
|
|
78
|
+
lower_limit = 0 if not index else interval_lines[index - 1].inferior_limit
|
|
79
|
+
next_line = interval_lines[index] if index < len(interval_lines) else None
|
|
80
|
+
interval_range = self._get_values_for_range_intervals(
|
|
81
|
+
lower_limit, next_line.inferior_limit
|
|
82
|
+
)
|
|
83
|
+
if (
|
|
84
|
+
days_difference in interval_range
|
|
85
|
+
or days_difference == line.inferior_limit
|
|
86
|
+
):
|
|
87
|
+
ag_pb_data[acc_id][line] += residual
|
|
88
|
+
ag_pb_data[acc_id][prt_id][line] += residual
|
|
89
|
+
break
|
|
94
90
|
return ag_pb_data
|
|
95
91
|
|
|
96
92
|
def _get_values_for_range_intervals(self, num1, num2):
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# Author: Julien Coux
|
|
2
2
|
# Copyright 2016 Camptocamp SA
|
|
3
|
-
# Copyright 2021 Tecnativa -
|
|
3
|
+
# Copyright 2021 Tecnativa - João Marques
|
|
4
4
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
|
5
5
|
|
|
6
|
-
from odoo import
|
|
6
|
+
from odoo import models
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
class AgedPartnerBalanceXslx(models.AbstractModel):
|
|
@@ -13,7 +13,7 @@ class AgedPartnerBalanceXslx(models.AbstractModel):
|
|
|
13
13
|
|
|
14
14
|
def _get_report_name(self, report, data=False):
|
|
15
15
|
company_id = data.get("company_id", False)
|
|
16
|
-
report_name = _("Aged Partner Balance")
|
|
16
|
+
report_name = self.env._("Aged Partner Balance")
|
|
17
17
|
if company_id:
|
|
18
18
|
company = self.env["res.company"].browse(company_id)
|
|
19
19
|
suffix = f" - {company.name} - {company.currency_id.name}"
|
|
@@ -22,16 +22,16 @@ class AgedPartnerBalanceXslx(models.AbstractModel):
|
|
|
22
22
|
|
|
23
23
|
def _get_report_columns_without_move_line_details(self, report, column_index):
|
|
24
24
|
report_columns = {
|
|
25
|
-
0: {"header": _("Partner"), "field": "name", "width": 70},
|
|
25
|
+
0: {"header": self.env._("Partner"), "field": "name", "width": 70},
|
|
26
26
|
1: {
|
|
27
|
-
"header": _("Residual"),
|
|
27
|
+
"header": self.env._("Residual"),
|
|
28
28
|
"field": "residual",
|
|
29
29
|
"field_footer_total": "residual",
|
|
30
30
|
"type": "amount",
|
|
31
31
|
"width": 14,
|
|
32
32
|
},
|
|
33
33
|
2: {
|
|
34
|
-
"header": _("Current"),
|
|
34
|
+
"header": self.env._("Current"),
|
|
35
35
|
"field": "current",
|
|
36
36
|
"field_footer_total": "current",
|
|
37
37
|
"field_footer_percent": "percent_current",
|
|
@@ -43,7 +43,7 @@ class AgedPartnerBalanceXslx(models.AbstractModel):
|
|
|
43
43
|
report_columns.update(
|
|
44
44
|
{
|
|
45
45
|
3: {
|
|
46
|
-
"header": _("Age ≤ 30 d."),
|
|
46
|
+
"header": self.env._("Age ≤ 30 d."),
|
|
47
47
|
"field": "30_days",
|
|
48
48
|
"field_footer_total": "30_days",
|
|
49
49
|
"field_footer_percent": "percent_30_days",
|
|
@@ -51,7 +51,7 @@ class AgedPartnerBalanceXslx(models.AbstractModel):
|
|
|
51
51
|
"width": 14,
|
|
52
52
|
},
|
|
53
53
|
4: {
|
|
54
|
-
"header": _("Age ≤ 60 d."),
|
|
54
|
+
"header": self.env._("Age ≤ 60 d."),
|
|
55
55
|
"field": "60_days",
|
|
56
56
|
"field_footer_total": "60_days",
|
|
57
57
|
"field_footer_percent": "percent_60_days",
|
|
@@ -59,7 +59,7 @@ class AgedPartnerBalanceXslx(models.AbstractModel):
|
|
|
59
59
|
"width": 14,
|
|
60
60
|
},
|
|
61
61
|
5: {
|
|
62
|
-
"header": _("Age ≤ 90 d."),
|
|
62
|
+
"header": self.env._("Age ≤ 90 d."),
|
|
63
63
|
"field": "90_days",
|
|
64
64
|
"field_footer_total": "90_days",
|
|
65
65
|
"field_footer_percent": "percent_90_days",
|
|
@@ -67,7 +67,7 @@ class AgedPartnerBalanceXslx(models.AbstractModel):
|
|
|
67
67
|
"width": 14,
|
|
68
68
|
},
|
|
69
69
|
6: {
|
|
70
|
-
"header": _("Age ≤ 120 d."),
|
|
70
|
+
"header": self.env._("Age ≤ 120 d."),
|
|
71
71
|
"field": "120_days",
|
|
72
72
|
"field_footer_total": "120_days",
|
|
73
73
|
"field_footer_percent": "percent_120_days",
|
|
@@ -75,7 +75,7 @@ class AgedPartnerBalanceXslx(models.AbstractModel):
|
|
|
75
75
|
"width": 14,
|
|
76
76
|
},
|
|
77
77
|
7: {
|
|
78
|
-
"header": _("Older"),
|
|
78
|
+
"header": self.env._("Older"),
|
|
79
79
|
"field": "older",
|
|
80
80
|
"field_footer_total": "older",
|
|
81
81
|
"field_footer_percent": "percent_older",
|
|
@@ -98,15 +98,15 @@ class AgedPartnerBalanceXslx(models.AbstractModel):
|
|
|
98
98
|
|
|
99
99
|
def _get_report_columns_with_move_line_details(self, report, column_index):
|
|
100
100
|
report_columns = {
|
|
101
|
-
0: {"header": _("Date"), "field": "date", "width": 11},
|
|
102
|
-
1: {"header": _("Entry"), "field": "entry", "width": 18},
|
|
103
|
-
2: {"header": _("Journal"), "field": "journal", "width": 8},
|
|
104
|
-
3: {"header": _("Account"), "field": "account", "width": 9},
|
|
105
|
-
4: {"header": _("Partner"), "field": "partner", "width": 25},
|
|
106
|
-
5: {"header": _("Ref - Label"), "field": "ref_label", "width": 40},
|
|
107
|
-
6: {"header": _("Due date"), "field": "due_date", "width": 11},
|
|
101
|
+
0: {"header": self.env._("Date"), "field": "date", "width": 11},
|
|
102
|
+
1: {"header": self.env._("Entry"), "field": "entry", "width": 18},
|
|
103
|
+
2: {"header": self.env._("Journal"), "field": "journal", "width": 8},
|
|
104
|
+
3: {"header": self.env._("Account"), "field": "account", "width": 9},
|
|
105
|
+
4: {"header": self.env._("Partner"), "field": "partner", "width": 25},
|
|
106
|
+
5: {"header": self.env._("Ref - Label"), "field": "ref_label", "width": 40},
|
|
107
|
+
6: {"header": self.env._("Due date"), "field": "due_date", "width": 11},
|
|
108
108
|
7: {
|
|
109
|
-
"header": _("Residual"),
|
|
109
|
+
"header": self.env._("Residual"),
|
|
110
110
|
"field": "residual",
|
|
111
111
|
"field_footer_total": "residual",
|
|
112
112
|
"field_final_balance": "residual",
|
|
@@ -114,7 +114,7 @@ class AgedPartnerBalanceXslx(models.AbstractModel):
|
|
|
114
114
|
"width": 14,
|
|
115
115
|
},
|
|
116
116
|
8: {
|
|
117
|
-
"header": _("Current"),
|
|
117
|
+
"header": self.env._("Current"),
|
|
118
118
|
"field": "current",
|
|
119
119
|
"field_footer_total": "current",
|
|
120
120
|
"field_footer_percent": "percent_current",
|
|
@@ -127,7 +127,7 @@ class AgedPartnerBalanceXslx(models.AbstractModel):
|
|
|
127
127
|
report_columns.update(
|
|
128
128
|
{
|
|
129
129
|
9: {
|
|
130
|
-
"header": _("Age ≤ 30 d."),
|
|
130
|
+
"header": self.env._("Age ≤ 30 d."),
|
|
131
131
|
"field": "30_days",
|
|
132
132
|
"field_footer_total": "30_days",
|
|
133
133
|
"field_footer_percent": "percent_30_days",
|
|
@@ -136,7 +136,7 @@ class AgedPartnerBalanceXslx(models.AbstractModel):
|
|
|
136
136
|
"width": 14,
|
|
137
137
|
},
|
|
138
138
|
10: {
|
|
139
|
-
"header": _("Age ≤ 60 d."),
|
|
139
|
+
"header": self.env._("Age ≤ 60 d."),
|
|
140
140
|
"field": "60_days",
|
|
141
141
|
"field_footer_total": "60_days",
|
|
142
142
|
"field_footer_percent": "percent_60_days",
|
|
@@ -145,7 +145,7 @@ class AgedPartnerBalanceXslx(models.AbstractModel):
|
|
|
145
145
|
"width": 14,
|
|
146
146
|
},
|
|
147
147
|
11: {
|
|
148
|
-
"header": _("Age ≤ 90 d."),
|
|
148
|
+
"header": self.env._("Age ≤ 90 d."),
|
|
149
149
|
"field": "90_days",
|
|
150
150
|
"field_footer_total": "90_days",
|
|
151
151
|
"field_footer_percent": "percent_90_days",
|
|
@@ -154,7 +154,7 @@ class AgedPartnerBalanceXslx(models.AbstractModel):
|
|
|
154
154
|
"width": 14,
|
|
155
155
|
},
|
|
156
156
|
12: {
|
|
157
|
-
"header": _("Age ≤ 120 d."),
|
|
157
|
+
"header": self.env._("Age ≤ 120 d."),
|
|
158
158
|
"field": "120_days",
|
|
159
159
|
"field_footer_total": "120_days",
|
|
160
160
|
"field_footer_percent": "percent_120_days",
|
|
@@ -163,7 +163,7 @@ class AgedPartnerBalanceXslx(models.AbstractModel):
|
|
|
163
163
|
"width": 14,
|
|
164
164
|
},
|
|
165
165
|
13: {
|
|
166
|
-
"header": _("Older"),
|
|
166
|
+
"header": self.env._("Older"),
|
|
167
167
|
"field": "older",
|
|
168
168
|
"field_footer_total": "older",
|
|
169
169
|
"field_footer_percent": "percent_older",
|
|
@@ -194,12 +194,12 @@ class AgedPartnerBalanceXslx(models.AbstractModel):
|
|
|
194
194
|
|
|
195
195
|
def _get_report_filters(self, report):
|
|
196
196
|
return [
|
|
197
|
-
[_("Date at filter"), report.date_at.strftime("%d/%m/%Y")],
|
|
197
|
+
[self.env._("Date at filter"), report.date_at.strftime("%d/%m/%Y")],
|
|
198
198
|
[
|
|
199
|
-
_("Target moves filter"),
|
|
200
|
-
_("All posted entries")
|
|
199
|
+
self.env._("Target moves filter"),
|
|
200
|
+
self.env._("All posted entries")
|
|
201
201
|
if report.target_move == "posted"
|
|
202
|
-
else _("All entries"),
|
|
202
|
+
else self.env._("All entries"),
|
|
203
203
|
],
|
|
204
204
|
]
|
|
205
205
|
|
|
@@ -321,7 +321,7 @@ class AgedPartnerBalanceXslx(models.AbstractModel):
|
|
|
321
321
|
for Aged Partner Balance
|
|
322
322
|
"""
|
|
323
323
|
name = None
|
|
324
|
-
label = _("Partner cumul aged balance")
|
|
324
|
+
label = self.env._("Partner cumul aged balance")
|
|
325
325
|
return super().write_ending_balance_from_dict(
|
|
326
326
|
my_object, name, label, report_data
|
|
327
327
|
)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# © 2016 Julien Coux (Camptocamp)
|
|
2
2
|
# Copyright 2020 ForgeFlow S.L. (https://www.forgeflow.com)
|
|
3
3
|
# Copyright 2022 Tecnativa - V??ctor Mart??nez
|
|
4
4
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
|
@@ -17,14 +17,18 @@ class GeneralLedgerReport(models.AbstractModel):
|
|
|
17
17
|
_inherit = "report.account_financial_report.abstract_report"
|
|
18
18
|
|
|
19
19
|
def _get_analytic_data(self, account_ids):
|
|
20
|
-
analytic_accounts = self.env["account.analytic.account"].
|
|
20
|
+
analytic_accounts = self.env["account.analytic.account"].search_fetch(
|
|
21
|
+
[("id", "in", account_ids)], ["name"]
|
|
22
|
+
)
|
|
21
23
|
analytic_data = {}
|
|
22
24
|
for account in analytic_accounts:
|
|
23
25
|
analytic_data.update({account.id: {"name": account.name}})
|
|
24
26
|
return analytic_data
|
|
25
27
|
|
|
26
28
|
def _get_taxes_data(self, taxes_ids):
|
|
27
|
-
taxes = self.env["account.tax"].
|
|
29
|
+
taxes = self.env["account.tax"].search_fetch(
|
|
30
|
+
[("id", "in", taxes_ids)], ["amount", "amount_type", "display_name"]
|
|
31
|
+
)
|
|
28
32
|
taxes_data = {}
|
|
29
33
|
for tax in taxes:
|
|
30
34
|
taxes_data.update(
|
|
@@ -61,7 +65,7 @@ class GeneralLedgerReport(models.AbstractModel):
|
|
|
61
65
|
|
|
62
66
|
def _get_acc_prt_accounts_ids(self, company_id, grouped_by):
|
|
63
67
|
accounts_domain = [
|
|
64
|
-
("
|
|
68
|
+
("company_ids", "in", [company_id]),
|
|
65
69
|
] + self._get_account_type_domain(grouped_by)
|
|
66
70
|
acc_prt_accounts = self.env["account.account"].search(accounts_domain)
|
|
67
71
|
return acc_prt_accounts.ids
|
|
@@ -70,7 +74,7 @@ class GeneralLedgerReport(models.AbstractModel):
|
|
|
70
74
|
self, account_ids, company_id, date_from, base_domain, grouped_by, acc_prt=False
|
|
71
75
|
):
|
|
72
76
|
accounts_domain = [
|
|
73
|
-
("
|
|
77
|
+
("company_ids", "in", [company_id]),
|
|
74
78
|
("include_initial_balance", "=", True),
|
|
75
79
|
]
|
|
76
80
|
if account_ids:
|
|
@@ -88,7 +92,7 @@ class GeneralLedgerReport(models.AbstractModel):
|
|
|
88
92
|
self, account_ids, company_id, date_from, fy_start_date, base_domain
|
|
89
93
|
):
|
|
90
94
|
accounts_domain = [
|
|
91
|
-
("
|
|
95
|
+
("company_ids", "in", [company_id]),
|
|
92
96
|
("include_initial_balance", "=", False),
|
|
93
97
|
]
|
|
94
98
|
if account_ids:
|
|
@@ -118,7 +122,7 @@ class GeneralLedgerReport(models.AbstractModel):
|
|
|
118
122
|
self, account_ids, company_id, fy_start_date, base_domain
|
|
119
123
|
):
|
|
120
124
|
accounts_domain = [
|
|
121
|
-
("
|
|
125
|
+
("company_ids", "in", [company_id]),
|
|
122
126
|
("include_initial_balance", "=", False),
|
|
123
127
|
]
|
|
124
128
|
if account_ids:
|
|
@@ -155,7 +159,13 @@ class GeneralLedgerReport(models.AbstractModel):
|
|
|
155
159
|
return pl_initial_balance
|
|
156
160
|
|
|
157
161
|
def _get_gl_initial_acc(
|
|
158
|
-
self,
|
|
162
|
+
self,
|
|
163
|
+
account_ids,
|
|
164
|
+
company_id,
|
|
165
|
+
date_from,
|
|
166
|
+
fy_start_date,
|
|
167
|
+
base_domain,
|
|
168
|
+
grouped_by,
|
|
159
169
|
):
|
|
160
170
|
initial_domain_bs = self._get_initial_balances_bs_ml_domain(
|
|
161
171
|
account_ids, company_id, date_from, base_domain, grouped_by
|
|
@@ -182,7 +192,7 @@ class GeneralLedgerReport(models.AbstractModel):
|
|
|
182
192
|
data[acc_id]["id"] = acc_id
|
|
183
193
|
if grouped_by:
|
|
184
194
|
data[acc_id][grouped_by] = False
|
|
185
|
-
method = "_prepare_gen_ld_data_group_
|
|
195
|
+
method = f"_prepare_gen_ld_data_group_{grouped_by}"
|
|
186
196
|
if not hasattr(self, method):
|
|
187
197
|
return data
|
|
188
198
|
return getattr(self, method)(data, domain, grouped_by)
|
|
@@ -265,7 +275,7 @@ class GeneralLedgerReport(models.AbstractModel):
|
|
|
265
275
|
unaffected_earnings_account = False
|
|
266
276
|
base_domain = []
|
|
267
277
|
if company_id:
|
|
268
|
-
base_domain += [("company_id", "
|
|
278
|
+
base_domain += [("company_id", "in", [company_id])]
|
|
269
279
|
if partner_ids:
|
|
270
280
|
base_domain += [("partner_id", "in", partner_ids)]
|
|
271
281
|
if only_posted_moves:
|
|
@@ -423,7 +433,9 @@ class GeneralLedgerReport(models.AbstractModel):
|
|
|
423
433
|
res.append({"id": item_id, "name": item_name})
|
|
424
434
|
elif move_line["tax_ids"]:
|
|
425
435
|
for tax_id in move_line["tax_ids"]:
|
|
426
|
-
tax_item = self.env["account.tax"].
|
|
436
|
+
tax_item = self.env["account.tax"].search_fetch(
|
|
437
|
+
[("id", "=", tax_id)], ["name"]
|
|
438
|
+
)
|
|
427
439
|
res.append({"id": tax_item.id, "name": tax_item.name})
|
|
428
440
|
else:
|
|
429
441
|
res.append({"id": 0, "name": "Missing Tax"})
|
|
@@ -517,9 +529,9 @@ class GeneralLedgerReport(models.AbstractModel):
|
|
|
517
529
|
"balance"
|
|
518
530
|
]
|
|
519
531
|
if foreign_currency:
|
|
520
|
-
gen_ld_data[acc_id][item_id]["fin_bal"][
|
|
521
|
-
"
|
|
522
|
-
|
|
532
|
+
gen_ld_data[acc_id][item_id]["fin_bal"]["bal_curr"] += (
|
|
533
|
+
move_line["amount_currency"]
|
|
534
|
+
)
|
|
523
535
|
else:
|
|
524
536
|
gen_ld_data[acc_id][ml_id] = self._get_move_line_data(move_line)
|
|
525
537
|
gen_ld_data[acc_id]["fin_bal"]["credit"] += move_line["credit"]
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Author: Damien Crier
|
|
2
2
|
# Author: Julien Coux
|
|
3
3
|
# Copyright 2016 Camptocamp SA
|
|
4
|
-
# Copyright 2021 Tecnativa -
|
|
4
|
+
# Copyright 2021 Tecnativa - João Marques
|
|
5
5
|
# Copyright 2022 Tecnativa - V??ctor Mart??nez
|
|
6
6
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
|
7
7
|
|
|
@@ -203,7 +203,7 @@ class GeneralLedgerXslx(models.AbstractModel):
|
|
|
203
203
|
)
|
|
204
204
|
else:
|
|
205
205
|
analytic_distribution += (
|
|
206
|
-
"
|
|
206
|
+
f"{analytic_data[int(account_id)]['name']} "
|
|
207
207
|
)
|
|
208
208
|
line.update(
|
|
209
209
|
{
|
|
@@ -313,7 +313,7 @@ class GeneralLedgerXslx(models.AbstractModel):
|
|
|
313
313
|
)
|
|
314
314
|
else:
|
|
315
315
|
analytic_distribution += (
|
|
316
|
-
"
|
|
316
|
+
f"{analytic_data[int(account_id)]['name']} "
|
|
317
317
|
)
|
|
318
318
|
line.update(
|
|
319
319
|
{
|
|
@@ -93,9 +93,9 @@ class JournalLedgerReport(models.AbstractModel):
|
|
|
93
93
|
return "move_id"
|
|
94
94
|
|
|
95
95
|
def _get_move_lines_data(self, ml, wizard, ml_taxes, auto_sequence, exigible):
|
|
96
|
-
base_debit = (
|
|
97
|
-
|
|
98
|
-
) =
|
|
96
|
+
base_debit = base_credit = tax_debit = tax_credit = base_balance = (
|
|
97
|
+
tax_balance
|
|
98
|
+
) = 0.0
|
|
99
99
|
if exigible:
|
|
100
100
|
base_debit = ml_taxes and ml.debit or 0.0
|
|
101
101
|
base_credit = ml_taxes and ml.credit or 0.0
|
|
@@ -264,7 +264,9 @@ class JournalLedgerReport(models.AbstractModel):
|
|
|
264
264
|
journal_id = ml_data["journal_id"]
|
|
265
265
|
if journal_id not in journals_taxes_data.keys():
|
|
266
266
|
journals_taxes_data[journal_id] = {}
|
|
267
|
-
taxes = self.env["account.tax"].
|
|
267
|
+
taxes = self.env["account.tax"].search_fetch(
|
|
268
|
+
[("id", "in", tax_ids)], ["name", "description"]
|
|
269
|
+
)
|
|
268
270
|
for tax in taxes:
|
|
269
271
|
if tax.id not in journals_taxes_data[journal_id]:
|
|
270
272
|
journals_taxes_data[journal_id][tax.id] = {
|
|
@@ -312,11 +314,9 @@ class JournalLedgerReport(models.AbstractModel):
|
|
|
312
314
|
if key not in journal_moves_data.keys():
|
|
313
315
|
journal_moves_data[key] = []
|
|
314
316
|
journal_moves_data[key] += list(items)
|
|
315
|
-
move_lines_data = (
|
|
316
|
-
|
|
317
|
-
) =
|
|
318
|
-
partner_ids_data
|
|
319
|
-
) = currency_ids_data = tax_line_ids_data = move_line_ids_taxes_data = {}
|
|
317
|
+
move_lines_data = account_ids_data = partner_ids_data = currency_ids_data = (
|
|
318
|
+
tax_line_ids_data
|
|
319
|
+
) = move_line_ids_taxes_data = {}
|
|
320
320
|
if move_ids:
|
|
321
321
|
move_lines = self._get_move_lines(move_ids, wizard, journal_ids)
|
|
322
322
|
move_lines_data = move_lines[1]
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Author: Damien Crier
|
|
2
2
|
# Author: Julien Coux
|
|
3
3
|
# Copyright 2016 Camptocamp SA
|
|
4
|
-
# Copyright 2021 Tecnativa -
|
|
4
|
+
# Copyright 2021 Tecnativa - João Marques
|
|
5
5
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
|
6
6
|
|
|
7
7
|
from odoo import _, models
|