odoo-addon-account-financial-report 15.0.1.1.0.1__py3-none-any.whl → 18.0.1.4.4.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.
- odoo/addons/account_financial_report/README.rst +131 -74
- odoo/addons/account_financial_report/__manifest__.py +6 -9
- odoo/addons/account_financial_report/i18n/account_financial_report.pot +313 -188
- odoo/addons/account_financial_report/i18n/ar.po +579 -433
- odoo/addons/account_financial_report/i18n/ca.po +474 -289
- odoo/addons/account_financial_report/i18n/{fr_FR.po → ca_AD.po} +539 -491
- odoo/addons/account_financial_report/i18n/ca_ES.po +1891 -0
- odoo/addons/account_financial_report/i18n/de.po +455 -295
- odoo/addons/account_financial_report/i18n/es.po +458 -394
- odoo/addons/account_financial_report/i18n/es_AR.po +464 -283
- odoo/addons/account_financial_report/i18n/es_MX.po +315 -220
- odoo/addons/account_financial_report/i18n/fr.po +620 -435
- odoo/addons/account_financial_report/i18n/fr_CH.po +616 -462
- odoo/addons/account_financial_report/i18n/hr.po +506 -355
- odoo/addons/account_financial_report/i18n/hr_HR.po +331 -232
- odoo/addons/account_financial_report/i18n/it.po +538 -356
- odoo/addons/account_financial_report/i18n/ja.po +339 -240
- odoo/addons/account_financial_report/i18n/nl.po +462 -324
- odoo/addons/account_financial_report/i18n/nl_NL.po +318 -220
- odoo/addons/account_financial_report/i18n/pt.po +429 -242
- odoo/addons/account_financial_report/i18n/pt_BR.po +588 -438
- odoo/addons/account_financial_report/i18n/ro.po +499 -342
- odoo/addons/account_financial_report/i18n/sl.po +1945 -0
- odoo/addons/account_financial_report/i18n/sv.po +1997 -0
- odoo/addons/account_financial_report/i18n/tr.po +1947 -0
- odoo/addons/account_financial_report/menuitems.xml +1 -1
- odoo/addons/account_financial_report/models/__init__.py +2 -0
- odoo/addons/account_financial_report/models/account_age_report_configuration.py +49 -0
- odoo/addons/account_financial_report/models/account_group.py +62 -23
- odoo/addons/account_financial_report/models/account_move_line.py +33 -3
- odoo/addons/account_financial_report/models/ir_actions_report.py +6 -4
- odoo/addons/account_financial_report/models/res_config_settings.py +36 -0
- odoo/addons/account_financial_report/readme/CONFIGURE.md +26 -0
- odoo/addons/account_financial_report/readme/CONTRIBUTORS.md +38 -0
- odoo/addons/account_financial_report/readme/CREDITS.md +1 -0
- odoo/addons/account_financial_report/readme/DESCRIPTION.md +21 -0
- odoo/addons/account_financial_report/readme/HISTORY.md +16 -0
- odoo/addons/account_financial_report/readme/ROADMAP.md +6 -0
- odoo/addons/account_financial_report/report/abstract_report.py +73 -23
- odoo/addons/account_financial_report/report/abstract_report_xlsx.py +28 -23
- odoo/addons/account_financial_report/report/aged_partner_balance.py +131 -30
- odoo/addons/account_financial_report/report/aged_partner_balance_xlsx.py +158 -118
- odoo/addons/account_financial_report/report/general_ledger.py +421 -340
- odoo/addons/account_financial_report/report/general_ledger_xlsx.py +127 -75
- odoo/addons/account_financial_report/report/journal_ledger.py +84 -68
- odoo/addons/account_financial_report/report/journal_ledger_xlsx.py +14 -8
- odoo/addons/account_financial_report/report/open_items.py +113 -70
- odoo/addons/account_financial_report/report/open_items_xlsx.py +152 -19
- odoo/addons/account_financial_report/report/templates/aged_partner_balance.xml +408 -311
- odoo/addons/account_financial_report/report/templates/general_ledger.xml +273 -213
- odoo/addons/account_financial_report/report/templates/journal_ledger.xml +70 -76
- odoo/addons/account_financial_report/report/templates/layouts.xml +12 -1
- odoo/addons/account_financial_report/report/templates/open_items.xml +181 -55
- odoo/addons/account_financial_report/report/templates/trial_balance.xml +304 -195
- odoo/addons/account_financial_report/report/templates/vat_report.xml +10 -10
- odoo/addons/account_financial_report/report/trial_balance.py +463 -211
- odoo/addons/account_financial_report/report/trial_balance_xlsx.py +37 -38
- odoo/addons/account_financial_report/report/vat_report.py +36 -25
- odoo/addons/account_financial_report/report/vat_report_xlsx.py +1 -1
- odoo/addons/account_financial_report/security/ir.model.access.csv +2 -0
- odoo/addons/account_financial_report/security/security.xml +8 -0
- odoo/addons/account_financial_report/static/description/index.html +106 -55
- odoo/addons/account_financial_report/static/src/css/report.css +77 -42
- odoo/addons/account_financial_report/static/src/css/report_html.css +10 -0
- odoo/addons/account_financial_report/static/src/js/report.esm.js +72 -0
- odoo/addons/account_financial_report/static/src/js/report_action.esm.js +39 -0
- odoo/addons/account_financial_report/static/src/xml/report.xml +10 -9
- odoo/addons/account_financial_report/tests/__init__.py +1 -0
- odoo/addons/account_financial_report/tests/test_age_report_configuration.py +42 -0
- odoo/addons/account_financial_report/tests/test_aged_partner_balance.py +99 -9
- odoo/addons/account_financial_report/tests/test_general_ledger.py +19 -9
- odoo/addons/account_financial_report/tests/test_journal_ledger.py +18 -9
- odoo/addons/account_financial_report/tests/test_open_items.py +42 -2
- odoo/addons/account_financial_report/tests/test_trial_balance.py +114 -223
- odoo/addons/account_financial_report/tests/test_vat_report.py +17 -9
- odoo/addons/account_financial_report/view/account_age_report_configuration_views.xml +41 -0
- odoo/addons/account_financial_report/view/res_config_settings_views.xml +51 -0
- odoo/addons/account_financial_report/wizard/abstract_wizard.py +23 -0
- odoo/addons/account_financial_report/wizard/aged_partner_balance_wizard.py +22 -8
- odoo/addons/account_financial_report/wizard/aged_partner_balance_wizard_view.xml +2 -3
- odoo/addons/account_financial_report/wizard/general_ledger_wizard.py +42 -36
- odoo/addons/account_financial_report/wizard/general_ledger_wizard_view.xml +26 -41
- odoo/addons/account_financial_report/wizard/journal_ledger_wizard.py +19 -7
- odoo/addons/account_financial_report/wizard/journal_ledger_wizard_view.xml +15 -14
- odoo/addons/account_financial_report/wizard/open_items_wizard.py +34 -8
- odoo/addons/account_financial_report/wizard/open_items_wizard_view.xml +16 -14
- odoo/addons/account_financial_report/wizard/trial_balance_wizard.py +68 -45
- odoo/addons/account_financial_report/wizard/trial_balance_wizard_view.xml +40 -39
- odoo/addons/account_financial_report/wizard/vat_report_wizard.py +9 -3
- odoo/addons/account_financial_report/wizard/vat_report_wizard_view.xml +14 -14
- odoo_addon_account_financial_report-18.0.1.4.4.3.dist-info/METADATA +234 -0
- odoo_addon_account_financial_report-18.0.1.4.4.3.dist-info/RECORD +107 -0
- {odoo_addon_account_financial_report-15.0.1.1.0.1.dist-info → odoo_addon_account_financial_report-18.0.1.4.4.3.dist-info}/WHEEL +1 -1
- odoo_addon_account_financial_report-18.0.1.4.4.3.dist-info/top_level.txt +1 -0
- odoo/addons/account_financial_report/readme/CONTRIBUTORS.rst +0 -35
- odoo/addons/account_financial_report/readme/DESCRIPTION.rst +0 -16
- odoo/addons/account_financial_report/readme/HISTORY.rst +0 -19
- odoo/addons/account_financial_report/readme/ROADMAP.rst +0 -7
- odoo/addons/account_financial_report/static/src/js/action_manager_report.js +0 -37
- odoo/addons/account_financial_report/static/src/js/client_action.js +0 -58
- odoo/addons/account_financial_report/static/src/js/report.js +0 -58
- odoo_addon_account_financial_report-15.0.1.1.0.1.dist-info/METADATA +0 -179
- odoo_addon_account_financial_report-15.0.1.1.0.1.dist-info/RECORD +0 -95
- odoo_addon_account_financial_report-15.0.1.1.0.1.dist-info/top_level.txt +0 -1
|
@@ -59,6 +59,10 @@ class OpenItemsReportWizard(models.TransientModel):
|
|
|
59
59
|
comodel_name="account.account",
|
|
60
60
|
help="Ending account in a range",
|
|
61
61
|
)
|
|
62
|
+
grouped_by = fields.Selection(
|
|
63
|
+
selection=[("partners", "Partners"), ("salesperson", "Partner Salesperson")],
|
|
64
|
+
default="partners",
|
|
65
|
+
)
|
|
62
66
|
|
|
63
67
|
@api.onchange("account_code_from", "account_code_to")
|
|
64
68
|
def on_change_account_range(self):
|
|
@@ -79,7 +83,7 @@ class OpenItemsReportWizard(models.TransientModel):
|
|
|
79
83
|
)
|
|
80
84
|
if self.company_id:
|
|
81
85
|
self.account_ids = self.account_ids.filtered(
|
|
82
|
-
lambda a:
|
|
86
|
+
lambda a: self.company_id in a.company_ids
|
|
83
87
|
)
|
|
84
88
|
return {
|
|
85
89
|
"domain": {
|
|
@@ -103,13 +107,13 @@ class OpenItemsReportWizard(models.TransientModel):
|
|
|
103
107
|
self.onchange_type_accounts_only()
|
|
104
108
|
else:
|
|
105
109
|
self.account_ids = self.account_ids.filtered(
|
|
106
|
-
lambda a:
|
|
110
|
+
lambda a: self.company_id in a.company_ids
|
|
107
111
|
)
|
|
108
112
|
res = {"domain": {"account_ids": [], "partner_ids": []}}
|
|
109
113
|
if not self.company_id:
|
|
110
114
|
return res
|
|
111
115
|
else:
|
|
112
|
-
res["domain"]["account_ids"] += [("
|
|
116
|
+
res["domain"]["account_ids"] += [("company_ids", "in", self.company_id.ids)]
|
|
113
117
|
res["domain"]["partner_ids"] += self._get_partner_ids_domain()
|
|
114
118
|
return res
|
|
115
119
|
|
|
@@ -120,21 +124,36 @@ class OpenItemsReportWizard(models.TransientModel):
|
|
|
120
124
|
@api.onchange("receivable_accounts_only", "payable_accounts_only")
|
|
121
125
|
def onchange_type_accounts_only(self):
|
|
122
126
|
"""Handle receivable/payable accounts only change."""
|
|
123
|
-
domain = [("
|
|
127
|
+
domain = [("company_ids", "in", [self.company_id.id])]
|
|
124
128
|
if self.receivable_accounts_only or self.payable_accounts_only:
|
|
125
129
|
if self.receivable_accounts_only and self.payable_accounts_only:
|
|
126
|
-
domain += [
|
|
130
|
+
domain += [
|
|
131
|
+
("account_type", "in", ("asset_receivable", "liability_payable"))
|
|
132
|
+
]
|
|
127
133
|
elif self.receivable_accounts_only:
|
|
128
|
-
domain += [("
|
|
134
|
+
domain += [("account_type", "=", "asset_receivable")]
|
|
129
135
|
elif self.payable_accounts_only:
|
|
130
|
-
domain += [("
|
|
136
|
+
domain += [("account_type", "=", "liability_payable")]
|
|
131
137
|
self.account_ids = self.env["account.account"].search(domain)
|
|
132
138
|
else:
|
|
133
139
|
self.account_ids = None
|
|
134
140
|
|
|
141
|
+
def _calculate_amounts_by_partner(self, account_id, open_items_move_lines_data):
|
|
142
|
+
total_amount = {}
|
|
143
|
+
for line in open_items_move_lines_data:
|
|
144
|
+
partner_id_key = line["partner_id"]
|
|
145
|
+
if account_id not in total_amount:
|
|
146
|
+
total_amount[account_id] = {}
|
|
147
|
+
if partner_id_key not in total_amount[account_id]:
|
|
148
|
+
total_amount[account_id][partner_id_key] = {"residual": 0.0}
|
|
149
|
+
total_amount[account_id][partner_id_key]["residual"] += line[
|
|
150
|
+
"amount_residual"
|
|
151
|
+
]
|
|
152
|
+
return total_amount
|
|
153
|
+
|
|
135
154
|
def _print_report(self, report_type):
|
|
136
155
|
self.ensure_one()
|
|
137
|
-
data = self.
|
|
156
|
+
data = self._prepare_report_data()
|
|
138
157
|
if report_type == "xlsx":
|
|
139
158
|
report_name = "a_f_r.report_open_items_xlsx"
|
|
140
159
|
else:
|
|
@@ -149,6 +168,7 @@ class OpenItemsReportWizard(models.TransientModel):
|
|
|
149
168
|
)
|
|
150
169
|
|
|
151
170
|
def _prepare_report_open_items(self):
|
|
171
|
+
# TODO: Kept for compatibility - To be merged into _prepare_report_data in 19
|
|
152
172
|
self.ensure_one()
|
|
153
173
|
return {
|
|
154
174
|
"wizard_id": self.id,
|
|
@@ -163,7 +183,13 @@ class OpenItemsReportWizard(models.TransientModel):
|
|
|
163
183
|
"account_ids": self.account_ids.ids,
|
|
164
184
|
"partner_ids": self.partner_ids.ids or [],
|
|
165
185
|
"account_financial_report_lang": self.env.lang,
|
|
186
|
+
"grouped_by": self.grouped_by,
|
|
166
187
|
}
|
|
167
188
|
|
|
189
|
+
def _prepare_report_data(self):
|
|
190
|
+
res = super()._prepare_report_data()
|
|
191
|
+
res.update(self._prepare_report_open_items())
|
|
192
|
+
return res
|
|
193
|
+
|
|
168
194
|
def _export(self, report_type):
|
|
169
195
|
return self._print_report(report_type)
|
|
@@ -21,8 +21,10 @@
|
|
|
21
21
|
<group name="other_filters">
|
|
22
22
|
<field name="target_move" widget="radio" />
|
|
23
23
|
<field name="show_partner_details" />
|
|
24
|
+
<field name="grouped_by" />
|
|
24
25
|
<field name="hide_account_at_0" />
|
|
25
26
|
<field name="foreign_currency" />
|
|
27
|
+
<field name="label_text_limit" />
|
|
26
28
|
</group>
|
|
27
29
|
</group>
|
|
28
30
|
<group name="partner_filter" col="1">
|
|
@@ -63,24 +65,24 @@
|
|
|
63
65
|
</group>
|
|
64
66
|
<footer>
|
|
65
67
|
<button
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
name="button_export_html"
|
|
69
|
+
string="View"
|
|
70
|
+
type="object"
|
|
71
|
+
default_focus="1"
|
|
72
|
+
class="oe_highlight"
|
|
73
|
+
/>
|
|
72
74
|
or
|
|
73
75
|
<button
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
name="button_export_pdf"
|
|
77
|
+
string="Export PDF"
|
|
78
|
+
type="object"
|
|
79
|
+
/>
|
|
78
80
|
or
|
|
79
81
|
<button
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
name="button_export_xlsx"
|
|
83
|
+
string="Export XLSX"
|
|
84
|
+
type="object"
|
|
85
|
+
/>
|
|
84
86
|
or
|
|
85
87
|
<button string="Cancel" class="oe_link" special="cancel" />
|
|
86
88
|
</footer>
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
# Copyright 2018 ForgeFlow, S.L.
|
|
5
5
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
|
6
6
|
|
|
7
|
-
from odoo import
|
|
7
|
+
from odoo import api, fields, models
|
|
8
8
|
from odoo.exceptions import UserError, ValidationError
|
|
9
9
|
from odoo.tools import date_utils
|
|
10
10
|
|
|
@@ -26,19 +26,9 @@ class TrialBalanceReportWizard(models.TransientModel):
|
|
|
26
26
|
required=True,
|
|
27
27
|
default="posted",
|
|
28
28
|
)
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
("relation", "Child Accounts"),
|
|
33
|
-
("none", "No hierarchy"),
|
|
34
|
-
],
|
|
35
|
-
required=True,
|
|
36
|
-
default="none",
|
|
37
|
-
help="""Computed Accounts: Use when the account group have codes
|
|
38
|
-
that represent prefixes of the actual accounts.\n
|
|
39
|
-
Child Accounts: Use when your account groups are hierarchical.\n
|
|
40
|
-
No hierarchy: Use to display just the accounts, without any grouping.
|
|
41
|
-
""",
|
|
29
|
+
show_hierarchy = fields.Boolean(
|
|
30
|
+
string="Show hierarchy",
|
|
31
|
+
help="Use when your account groups are hierarchical",
|
|
42
32
|
)
|
|
43
33
|
limit_hierarchy_level = fields.Boolean("Limit hierarchy levels")
|
|
44
34
|
show_hierarchy_level = fields.Integer("Hierarchy Levels to display", default=1)
|
|
@@ -60,9 +50,10 @@ class TrialBalanceReportWizard(models.TransientModel):
|
|
|
60
50
|
show_partner_details = fields.Boolean()
|
|
61
51
|
partner_ids = fields.Many2many(comodel_name="res.partner", string="Filter partners")
|
|
62
52
|
journal_ids = fields.Many2many(comodel_name="account.journal")
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
53
|
+
only_one_unaffected_earnings_account = fields.Boolean(
|
|
54
|
+
readonly=True,
|
|
55
|
+
default=lambda self: self._only_one_unaffected_earnings_account(),
|
|
56
|
+
)
|
|
66
57
|
foreign_currency = fields.Boolean(
|
|
67
58
|
string="Show foreign currency",
|
|
68
59
|
help="Display foreign currency for move lines, unless "
|
|
@@ -77,6 +68,15 @@ class TrialBalanceReportWizard(models.TransientModel):
|
|
|
77
68
|
comodel_name="account.account",
|
|
78
69
|
help="Ending account in a range",
|
|
79
70
|
)
|
|
71
|
+
grouped_by = fields.Selection(
|
|
72
|
+
selection=[("analytic_account", "Analytic Account")], default=False
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
@api.onchange("grouped_by")
|
|
76
|
+
def onchange_grouped_by(self):
|
|
77
|
+
if self.grouped_by == "analytic_account":
|
|
78
|
+
self.show_partner_details = False
|
|
79
|
+
self.show_hierarchy = False
|
|
80
80
|
|
|
81
81
|
@api.onchange("account_code_from", "account_code_to")
|
|
82
82
|
def on_change_account_range(self):
|
|
@@ -86,22 +86,32 @@ class TrialBalanceReportWizard(models.TransientModel):
|
|
|
86
86
|
and self.account_code_to
|
|
87
87
|
and self.account_code_to.code.isdigit()
|
|
88
88
|
):
|
|
89
|
-
start_range =
|
|
90
|
-
end_range =
|
|
89
|
+
start_range = self.account_code_from.code
|
|
90
|
+
end_range = self.account_code_to.code
|
|
91
91
|
self.account_ids = self.env["account.account"].search(
|
|
92
92
|
[("code", ">=", start_range), ("code", "<=", end_range)]
|
|
93
93
|
)
|
|
94
|
-
if self.
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
94
|
+
if isinstance(self.account_ids[0].id, models.NewId):
|
|
95
|
+
real_ids = self.account_ids.ids
|
|
96
|
+
account_ids = self.env["account.account"].browse(real_ids)
|
|
97
|
+
if self.company_id:
|
|
98
|
+
self.account_ids = account_ids.filtered(
|
|
99
|
+
lambda a: self.company_id in a.company_ids
|
|
100
|
+
)
|
|
101
|
+
else:
|
|
102
|
+
if self.company_id:
|
|
103
|
+
self.account_ids = self.account_ids.filtered(
|
|
104
|
+
lambda a: self.company_id in a.company_ids
|
|
105
|
+
)
|
|
98
106
|
|
|
99
|
-
@api.constrains("
|
|
107
|
+
@api.constrains("show_hierarchy", "show_hierarchy_level")
|
|
100
108
|
def _check_show_hierarchy_level(self):
|
|
101
109
|
for rec in self:
|
|
102
|
-
if rec.
|
|
110
|
+
if rec.show_hierarchy and rec.show_hierarchy_level <= 0:
|
|
103
111
|
raise UserError(
|
|
104
|
-
_(
|
|
112
|
+
self.env._(
|
|
113
|
+
"The hierarchy level to filter on must be greater than 0."
|
|
114
|
+
)
|
|
105
115
|
)
|
|
106
116
|
|
|
107
117
|
@api.depends("date_from")
|
|
@@ -117,17 +127,21 @@ class TrialBalanceReportWizard(models.TransientModel):
|
|
|
117
127
|
else:
|
|
118
128
|
wiz.fy_start_date = False
|
|
119
129
|
|
|
120
|
-
|
|
121
|
-
def onchange_company_id(self):
|
|
122
|
-
"""Handle company change."""
|
|
123
|
-
account_type = self.env.ref("account.data_unaffected_earnings")
|
|
130
|
+
def _only_one_unaffected_earnings_account(self):
|
|
124
131
|
count = self.env["account.account"].search_count(
|
|
125
132
|
[
|
|
126
|
-
("
|
|
127
|
-
("
|
|
133
|
+
("account_type", "=", "equity_unaffected"),
|
|
134
|
+
("company_ids", "in", [self.company_id.id or self.env.company.id]),
|
|
128
135
|
]
|
|
129
136
|
)
|
|
130
|
-
|
|
137
|
+
return count == 1
|
|
138
|
+
|
|
139
|
+
@api.onchange("company_id")
|
|
140
|
+
def onchange_company_id(self):
|
|
141
|
+
"""Handle company change."""
|
|
142
|
+
self.only_one_unaffected_earnings_account = (
|
|
143
|
+
self._only_one_unaffected_earnings_account()
|
|
144
|
+
)
|
|
131
145
|
if (
|
|
132
146
|
self.company_id
|
|
133
147
|
and self.date_range_id.company_id
|
|
@@ -147,7 +161,7 @@ class TrialBalanceReportWizard(models.TransientModel):
|
|
|
147
161
|
self.onchange_type_accounts_only()
|
|
148
162
|
else:
|
|
149
163
|
self.account_ids = self.account_ids.filtered(
|
|
150
|
-
lambda a:
|
|
164
|
+
lambda a: self.company_id in a.company_ids
|
|
151
165
|
)
|
|
152
166
|
res = {
|
|
153
167
|
"domain": {
|
|
@@ -160,7 +174,7 @@ class TrialBalanceReportWizard(models.TransientModel):
|
|
|
160
174
|
if not self.company_id:
|
|
161
175
|
return res
|
|
162
176
|
else:
|
|
163
|
-
res["domain"]["account_ids"] += [("
|
|
177
|
+
res["domain"]["account_ids"] += [("company_ids", "in", self.company_id.ids)]
|
|
164
178
|
res["domain"]["partner_ids"] += self._get_partner_ids_domain()
|
|
165
179
|
res["domain"]["date_range_id"] += [
|
|
166
180
|
"|",
|
|
@@ -185,7 +199,7 @@ class TrialBalanceReportWizard(models.TransientModel):
|
|
|
185
199
|
and rec.company_id != rec.date_range_id.company_id
|
|
186
200
|
):
|
|
187
201
|
raise ValidationError(
|
|
188
|
-
_(
|
|
202
|
+
self.env._(
|
|
189
203
|
"The Company in the Trial Balance Report Wizard and in "
|
|
190
204
|
"Date Range must be the same."
|
|
191
205
|
)
|
|
@@ -195,13 +209,15 @@ class TrialBalanceReportWizard(models.TransientModel):
|
|
|
195
209
|
def onchange_type_accounts_only(self):
|
|
196
210
|
"""Handle receivable/payable accounts only change."""
|
|
197
211
|
if self.receivable_accounts_only or self.payable_accounts_only:
|
|
198
|
-
domain = [("
|
|
212
|
+
domain = [("company_ids", "in", [self.company_id.id])]
|
|
199
213
|
if self.receivable_accounts_only and self.payable_accounts_only:
|
|
200
|
-
domain += [
|
|
214
|
+
domain += [
|
|
215
|
+
("account_type", "in", ("asset_receivable", "liability_payable"))
|
|
216
|
+
]
|
|
201
217
|
elif self.receivable_accounts_only:
|
|
202
|
-
domain += [("
|
|
218
|
+
domain += [("account_type", "=", "asset_receivable")]
|
|
203
219
|
elif self.payable_accounts_only:
|
|
204
|
-
domain += [("
|
|
220
|
+
domain += [("account_type", "=", "liability_payable")]
|
|
205
221
|
self.account_ids = self.env["account.account"].search(domain)
|
|
206
222
|
else:
|
|
207
223
|
self.account_ids = None
|
|
@@ -211,17 +227,17 @@ class TrialBalanceReportWizard(models.TransientModel):
|
|
|
211
227
|
"""Handle partners change."""
|
|
212
228
|
if self.show_partner_details:
|
|
213
229
|
self.receivable_accounts_only = self.payable_accounts_only = True
|
|
230
|
+
self.grouped_by = False
|
|
214
231
|
else:
|
|
215
232
|
self.receivable_accounts_only = self.payable_accounts_only = False
|
|
216
233
|
|
|
217
234
|
@api.depends("company_id")
|
|
218
235
|
def _compute_unaffected_earnings_account(self):
|
|
219
|
-
account_type = self.env.ref("account.data_unaffected_earnings")
|
|
220
236
|
for record in self:
|
|
221
237
|
record.unaffected_earnings_account = self.env["account.account"].search(
|
|
222
238
|
[
|
|
223
|
-
("
|
|
224
|
-
("
|
|
239
|
+
("account_type", "=", "equity_unaffected"),
|
|
240
|
+
("company_ids", "in", [record.company_id.id]),
|
|
225
241
|
]
|
|
226
242
|
)
|
|
227
243
|
|
|
@@ -233,7 +249,7 @@ class TrialBalanceReportWizard(models.TransientModel):
|
|
|
233
249
|
|
|
234
250
|
def _print_report(self, report_type):
|
|
235
251
|
self.ensure_one()
|
|
236
|
-
data = self.
|
|
252
|
+
data = self._prepare_report_data()
|
|
237
253
|
if report_type == "xlsx":
|
|
238
254
|
report_name = "a_f_r.report_trial_balance_xlsx"
|
|
239
255
|
else:
|
|
@@ -248,6 +264,7 @@ class TrialBalanceReportWizard(models.TransientModel):
|
|
|
248
264
|
)
|
|
249
265
|
|
|
250
266
|
def _prepare_report_trial_balance(self):
|
|
267
|
+
# TODO: Kept for compatibility - To be merged into _prepare_report_data in 19
|
|
251
268
|
self.ensure_one()
|
|
252
269
|
return {
|
|
253
270
|
"wizard_id": self.id,
|
|
@@ -261,15 +278,21 @@ class TrialBalanceReportWizard(models.TransientModel):
|
|
|
261
278
|
"partner_ids": self.partner_ids.ids or [],
|
|
262
279
|
"journal_ids": self.journal_ids.ids or [],
|
|
263
280
|
"fy_start_date": self.fy_start_date,
|
|
264
|
-
"
|
|
281
|
+
"show_hierarchy": self.show_hierarchy,
|
|
265
282
|
"limit_hierarchy_level": self.limit_hierarchy_level,
|
|
266
283
|
"show_hierarchy_level": self.show_hierarchy_level,
|
|
267
284
|
"hide_parent_hierarchy_level": self.hide_parent_hierarchy_level,
|
|
268
285
|
"show_partner_details": self.show_partner_details,
|
|
269
286
|
"unaffected_earnings_account": self.unaffected_earnings_account.id,
|
|
270
287
|
"account_financial_report_lang": self.env.lang,
|
|
288
|
+
"grouped_by": self.grouped_by,
|
|
271
289
|
}
|
|
272
290
|
|
|
291
|
+
def _prepare_report_data(self):
|
|
292
|
+
res = super()._prepare_report_data()
|
|
293
|
+
res.update(self._prepare_report_trial_balance())
|
|
294
|
+
return res
|
|
295
|
+
|
|
273
296
|
def _export(self, report_type):
|
|
274
297
|
"""Default export is PDF."""
|
|
275
298
|
return self._print_report(report_type)
|
|
@@ -6,6 +6,14 @@
|
|
|
6
6
|
<field name="model">trial.balance.report.wizard</field>
|
|
7
7
|
<field name="arch" type="xml">
|
|
8
8
|
<form>
|
|
9
|
+
<div
|
|
10
|
+
class="alert alert-warning"
|
|
11
|
+
role="alert"
|
|
12
|
+
invisible="grouped_by!='analytic_account'"
|
|
13
|
+
>
|
|
14
|
+
<i class="fa fa-exclamation-triangle mr-3" />
|
|
15
|
+
Duplicate amounts may be shown because more than one analytical account may be defined in the journal items.
|
|
16
|
+
</div>
|
|
9
17
|
<group name="main_info">
|
|
10
18
|
<field
|
|
11
19
|
name="company_id"
|
|
@@ -13,9 +21,7 @@
|
|
|
13
21
|
groups="base.group_multi_company"
|
|
14
22
|
/>
|
|
15
23
|
</group>
|
|
16
|
-
<div
|
|
17
|
-
attrs="{'invisible': [('not_only_one_unaffected_earnings_account', '=', True)]}"
|
|
18
|
-
>
|
|
24
|
+
<div invisible="not only_one_unaffected_earnings_account">
|
|
19
25
|
<group name="filters">
|
|
20
26
|
<group name="date_range">
|
|
21
27
|
<field name="date_range_id" />
|
|
@@ -25,31 +31,35 @@
|
|
|
25
31
|
</group>
|
|
26
32
|
<group name="other_filters">
|
|
27
33
|
<field name="target_move" widget="radio" />
|
|
34
|
+
<field name="grouped_by" invisible="1" />
|
|
35
|
+
<field
|
|
36
|
+
name="grouped_by"
|
|
37
|
+
groups="analytic.group_analytic_accounting"
|
|
38
|
+
/>
|
|
28
39
|
<field name="hide_account_at_0" />
|
|
29
|
-
<field name="show_partner_details" />
|
|
40
|
+
<field name="show_partner_details" invisible="grouped_by" />
|
|
30
41
|
<field
|
|
31
|
-
name="
|
|
32
|
-
|
|
33
|
-
attrs="{'invisible':[('show_partner_details','=',True)]}"
|
|
42
|
+
name="show_hierarchy"
|
|
43
|
+
invisible="show_partner_details == True or grouped_by"
|
|
34
44
|
/>
|
|
35
45
|
<field
|
|
36
46
|
name="limit_hierarchy_level"
|
|
37
|
-
|
|
47
|
+
invisible="show_hierarchy == False or show_partner_details == True"
|
|
38
48
|
/>
|
|
39
49
|
<field
|
|
40
50
|
name="show_hierarchy_level"
|
|
41
|
-
|
|
51
|
+
invisible="limit_hierarchy_level == False"
|
|
42
52
|
/>
|
|
43
53
|
<field
|
|
44
54
|
name="hide_parent_hierarchy_level"
|
|
45
|
-
|
|
55
|
+
invisible="limit_hierarchy_level == False"
|
|
46
56
|
/>
|
|
47
57
|
<field name="foreign_currency" />
|
|
48
58
|
</group>
|
|
49
59
|
</group>
|
|
50
60
|
<group
|
|
51
61
|
name="partner_filter"
|
|
52
|
-
|
|
62
|
+
invisible="show_partner_details == True"
|
|
53
63
|
col="1"
|
|
54
64
|
>
|
|
55
65
|
<label for="partner_ids" />
|
|
@@ -67,7 +77,7 @@
|
|
|
67
77
|
nolabel="1"
|
|
68
78
|
options="{'no_create': True}"
|
|
69
79
|
/>
|
|
70
|
-
<group
|
|
80
|
+
<group invisible="show_partner_details == True" />
|
|
71
81
|
<div />
|
|
72
82
|
<group name="account_filter" col="4">
|
|
73
83
|
<label for="account_ids" colspan="4" />
|
|
@@ -98,13 +108,8 @@
|
|
|
98
108
|
/>
|
|
99
109
|
</group>
|
|
100
110
|
</div>
|
|
101
|
-
<div
|
|
102
|
-
|
|
103
|
-
>
|
|
104
|
-
<field
|
|
105
|
-
name="not_only_one_unaffected_earnings_account"
|
|
106
|
-
invisible="1"
|
|
107
|
-
/>
|
|
111
|
+
<div invisible="only_one_unaffected_earnings_account">
|
|
112
|
+
<field name="only_one_unaffected_earnings_account" invisible="1" />
|
|
108
113
|
<group />
|
|
109
114
|
<h4>
|
|
110
115
|
Trial Balance can be computed only if selected company have only
|
|
@@ -113,34 +118,30 @@
|
|
|
113
118
|
<group />
|
|
114
119
|
</div>
|
|
115
120
|
<footer>
|
|
116
|
-
<div
|
|
117
|
-
attrs="{'invisible': [('not_only_one_unaffected_earnings_account', '=', True)]}"
|
|
118
|
-
>
|
|
121
|
+
<div invisible="not only_one_unaffected_earnings_account">
|
|
119
122
|
<button
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
123
|
+
name="button_export_html"
|
|
124
|
+
string="View"
|
|
125
|
+
type="object"
|
|
126
|
+
default_focus="1"
|
|
127
|
+
class="oe_highlight"
|
|
128
|
+
/>
|
|
126
129
|
or
|
|
127
130
|
<button
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
131
|
+
name="button_export_pdf"
|
|
132
|
+
string="Export PDF"
|
|
133
|
+
type="object"
|
|
134
|
+
/>
|
|
132
135
|
or
|
|
133
136
|
<button
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
137
|
+
name="button_export_xlsx"
|
|
138
|
+
string="Export XLSX"
|
|
139
|
+
type="object"
|
|
140
|
+
/>
|
|
138
141
|
or
|
|
139
142
|
<button string="Cancel" class="oe_link" special="cancel" />
|
|
140
143
|
</div>
|
|
141
|
-
<div
|
|
142
|
-
attrs="{'invisible': [('not_only_one_unaffected_earnings_account', '=', False)]}"
|
|
143
|
-
>
|
|
144
|
+
<div invisible="only_one_unaffected_earnings_account">
|
|
144
145
|
<button string="Cancel" class="oe_link" special="cancel" />
|
|
145
146
|
</div>
|
|
146
147
|
</footer>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Copyright 2018 Forest and Biomass Romania
|
|
2
2
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
|
3
3
|
|
|
4
|
-
from odoo import
|
|
4
|
+
from odoo import api, fields, models
|
|
5
5
|
from odoo.exceptions import ValidationError
|
|
6
6
|
|
|
7
7
|
|
|
@@ -60,7 +60,7 @@ class VATReportWizard(models.TransientModel):
|
|
|
60
60
|
and rec.company_id != rec.date_range_id.company_id
|
|
61
61
|
):
|
|
62
62
|
raise ValidationError(
|
|
63
|
-
_(
|
|
63
|
+
self.env._(
|
|
64
64
|
"The Company in the Vat Report Wizard and in "
|
|
65
65
|
"Date Range must be the same."
|
|
66
66
|
)
|
|
@@ -68,7 +68,7 @@ class VATReportWizard(models.TransientModel):
|
|
|
68
68
|
|
|
69
69
|
def _print_report(self, report_type):
|
|
70
70
|
self.ensure_one()
|
|
71
|
-
data = self.
|
|
71
|
+
data = self._prepare_report_data()
|
|
72
72
|
if report_type == "xlsx":
|
|
73
73
|
report_name = "a_f_r.report_vat_report_xlsx"
|
|
74
74
|
else:
|
|
@@ -83,6 +83,7 @@ class VATReportWizard(models.TransientModel):
|
|
|
83
83
|
)
|
|
84
84
|
|
|
85
85
|
def _prepare_vat_report(self):
|
|
86
|
+
# TODO: Kept for compatibility - To be merged into _prepare_report_data in 19
|
|
86
87
|
self.ensure_one()
|
|
87
88
|
return {
|
|
88
89
|
"wizard_id": self.id,
|
|
@@ -95,6 +96,11 @@ class VATReportWizard(models.TransientModel):
|
|
|
95
96
|
"account_financial_report_lang": self.env.lang,
|
|
96
97
|
}
|
|
97
98
|
|
|
99
|
+
def _prepare_report_data(self):
|
|
100
|
+
res = super()._prepare_report_data()
|
|
101
|
+
res.update(self._prepare_vat_report())
|
|
102
|
+
return res
|
|
103
|
+
|
|
98
104
|
def _export(self, report_type):
|
|
99
105
|
"""Default export is PDF."""
|
|
100
106
|
return self._print_report(report_type)
|
|
@@ -26,24 +26,24 @@
|
|
|
26
26
|
</group>
|
|
27
27
|
<footer>
|
|
28
28
|
<button
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
name="button_export_html"
|
|
30
|
+
string="View"
|
|
31
|
+
type="object"
|
|
32
|
+
default_focus="1"
|
|
33
|
+
class="oe_highlight"
|
|
34
|
+
/>
|
|
35
35
|
or
|
|
36
36
|
<button
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
name="button_export_pdf"
|
|
38
|
+
string="Export PDF"
|
|
39
|
+
type="object"
|
|
40
|
+
/>
|
|
41
41
|
or
|
|
42
42
|
<button
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
name="button_export_xlsx"
|
|
44
|
+
string="Export XLSX"
|
|
45
|
+
type="object"
|
|
46
|
+
/>
|
|
47
47
|
or
|
|
48
48
|
<button string="Cancel" class="oe_link" special="cancel" />
|
|
49
49
|
</footer>
|