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
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" ?>
|
|
2
|
+
<!-- Copyright 2023 Tecnativa - Carolina Fernandez
|
|
3
|
+
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). -->
|
|
4
|
+
<odoo>
|
|
5
|
+
<record id="res_config_settings_view_form" model="ir.ui.view">
|
|
6
|
+
<field name="model">res.config.settings</field>
|
|
7
|
+
<field name="inherit_id" ref="account.res_config_settings_view_form" />
|
|
8
|
+
<field name="arch" type="xml">
|
|
9
|
+
<xpath expr="//block[@id='analytic']" position="after">
|
|
10
|
+
<block
|
|
11
|
+
title="OCA Aged Report Configuration"
|
|
12
|
+
id="oca_aged_report_config"
|
|
13
|
+
>
|
|
14
|
+
<div
|
|
15
|
+
id="main_oca_aged_report_config"
|
|
16
|
+
class="col-12 col-lg-12 o_setting_box"
|
|
17
|
+
>
|
|
18
|
+
<div class="o_setting_left_pane" />
|
|
19
|
+
<div class="o_setting_right_pane">
|
|
20
|
+
<span class="o_form_label">Intervals configuration</span>
|
|
21
|
+
<div class="text-muted">
|
|
22
|
+
Here you can set the intervals that will appear on the Aged Partner Balance.
|
|
23
|
+
</div>
|
|
24
|
+
<div class="content-group">
|
|
25
|
+
<div class="row mt16">
|
|
26
|
+
<label
|
|
27
|
+
for="age_partner_config_id"
|
|
28
|
+
class="col-lg-3 o_light_label"
|
|
29
|
+
/>
|
|
30
|
+
<field
|
|
31
|
+
name="age_partner_config_id"
|
|
32
|
+
options="{'no_create_edit': True, 'no_open': True}"
|
|
33
|
+
/>
|
|
34
|
+
</div>
|
|
35
|
+
<div class="mt8">
|
|
36
|
+
<button
|
|
37
|
+
type="action"
|
|
38
|
+
name="%(account_financial_report.action_aged_partner_report_configuration)d"
|
|
39
|
+
string="Configurations"
|
|
40
|
+
class="btn-link"
|
|
41
|
+
icon="fa-arrow-right"
|
|
42
|
+
/>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
</div>
|
|
46
|
+
</div>
|
|
47
|
+
</block>
|
|
48
|
+
</xpath>
|
|
49
|
+
</field>
|
|
50
|
+
</record>
|
|
51
|
+
</odoo>
|
|
@@ -34,18 +34,41 @@ class AbstractWizard(models.AbstractModel):
|
|
|
34
34
|
required=False,
|
|
35
35
|
string="Company",
|
|
36
36
|
)
|
|
37
|
+
label_text_limit = fields.Integer(default=40)
|
|
37
38
|
|
|
38
39
|
def button_export_html(self):
|
|
39
40
|
self.ensure_one()
|
|
41
|
+
self._set_default_wizard_values()
|
|
40
42
|
report_type = "qweb-html"
|
|
41
43
|
return self._export(report_type)
|
|
42
44
|
|
|
43
45
|
def button_export_pdf(self):
|
|
44
46
|
self.ensure_one()
|
|
47
|
+
self._set_default_wizard_values()
|
|
45
48
|
report_type = "qweb-pdf"
|
|
46
49
|
return self._export(report_type)
|
|
47
50
|
|
|
48
51
|
def button_export_xlsx(self):
|
|
49
52
|
self.ensure_one()
|
|
53
|
+
self._set_default_wizard_values()
|
|
50
54
|
report_type = "xlsx"
|
|
51
55
|
return self._export(report_type)
|
|
56
|
+
|
|
57
|
+
def _limit_text(self, value, limit_field="label_text_limit"):
|
|
58
|
+
limit = self[limit_field]
|
|
59
|
+
if value and limit and len(value) > limit:
|
|
60
|
+
value = value[:limit] + "..."
|
|
61
|
+
return value
|
|
62
|
+
|
|
63
|
+
def _prepare_report_data(self):
|
|
64
|
+
self.ensure_one()
|
|
65
|
+
return {"wizard_name": self._name, "wizard_id": self.id}
|
|
66
|
+
|
|
67
|
+
def _set_default_wizard_values(self):
|
|
68
|
+
self.env["ir.default"].sudo().set(
|
|
69
|
+
self._name,
|
|
70
|
+
"label_text_limit",
|
|
71
|
+
self.label_text_limit,
|
|
72
|
+
user_id=False,
|
|
73
|
+
company_id=True,
|
|
74
|
+
)
|
|
@@ -40,6 +40,9 @@ class AgedPartnerBalanceWizard(models.TransientModel):
|
|
|
40
40
|
comodel_name="account.account",
|
|
41
41
|
help="Ending account in a range",
|
|
42
42
|
)
|
|
43
|
+
age_partner_config_id = fields.Many2one(
|
|
44
|
+
"account.age.report.configuration", string="Intervals configuration"
|
|
45
|
+
)
|
|
43
46
|
|
|
44
47
|
@api.onchange("account_code_from", "account_code_to")
|
|
45
48
|
def on_change_account_range(self):
|
|
@@ -60,7 +63,7 @@ class AgedPartnerBalanceWizard(models.TransientModel):
|
|
|
60
63
|
)
|
|
61
64
|
if self.company_id:
|
|
62
65
|
self.account_ids = self.account_ids.filtered(
|
|
63
|
-
lambda a:
|
|
66
|
+
lambda a: self.company_id in a.company_ids
|
|
64
67
|
)
|
|
65
68
|
return {
|
|
66
69
|
"domain": {
|
|
@@ -81,13 +84,15 @@ class AgedPartnerBalanceWizard(models.TransientModel):
|
|
|
81
84
|
self.onchange_type_accounts_only()
|
|
82
85
|
else:
|
|
83
86
|
self.account_ids = self.account_ids.filtered(
|
|
84
|
-
lambda a:
|
|
87
|
+
lambda a: self.company_id in a.company_ids
|
|
85
88
|
)
|
|
86
89
|
res = {"domain": {"account_ids": [], "partner_ids": []}}
|
|
87
90
|
if not self.company_id:
|
|
88
91
|
return res
|
|
89
92
|
else:
|
|
90
|
-
res["domain"]["account_ids"] += [
|
|
93
|
+
res["domain"]["account_ids"] += [
|
|
94
|
+
("company_ids", "in", [self.company_id.id])
|
|
95
|
+
]
|
|
91
96
|
res["domain"]["partner_ids"] += self._get_partner_ids_domain()
|
|
92
97
|
return res
|
|
93
98
|
|
|
@@ -98,21 +103,23 @@ class AgedPartnerBalanceWizard(models.TransientModel):
|
|
|
98
103
|
@api.onchange("receivable_accounts_only", "payable_accounts_only")
|
|
99
104
|
def onchange_type_accounts_only(self):
|
|
100
105
|
"""Handle receivable/payable accounts only change."""
|
|
101
|
-
domain = [("
|
|
106
|
+
domain = [("company_ids", "in", [self.company_id.id])]
|
|
102
107
|
if self.receivable_accounts_only or self.payable_accounts_only:
|
|
103
108
|
if self.receivable_accounts_only and self.payable_accounts_only:
|
|
104
|
-
domain += [
|
|
109
|
+
domain += [
|
|
110
|
+
("account_type", "in", ("asset_receivable", "liability_payable"))
|
|
111
|
+
]
|
|
105
112
|
elif self.receivable_accounts_only:
|
|
106
|
-
domain += [("
|
|
113
|
+
domain += [("account_type", "=", "asset_receivable")]
|
|
107
114
|
elif self.payable_accounts_only:
|
|
108
|
-
domain += [("
|
|
115
|
+
domain += [("account_type", "=", "liability_payable")]
|
|
109
116
|
self.account_ids = self.env["account.account"].search(domain)
|
|
110
117
|
else:
|
|
111
118
|
self.account_ids = None
|
|
112
119
|
|
|
113
120
|
def _print_report(self, report_type):
|
|
114
121
|
self.ensure_one()
|
|
115
|
-
data = self.
|
|
122
|
+
data = self._prepare_report_data()
|
|
116
123
|
if report_type == "xlsx":
|
|
117
124
|
report_name = "a_f_r.report_aged_partner_balance_xlsx"
|
|
118
125
|
else:
|
|
@@ -127,6 +134,7 @@ class AgedPartnerBalanceWizard(models.TransientModel):
|
|
|
127
134
|
)
|
|
128
135
|
|
|
129
136
|
def _prepare_report_aged_partner_balance(self):
|
|
137
|
+
# TODO: Kept for compatibility - To be merged into _prepare_report_data in 19
|
|
130
138
|
self.ensure_one()
|
|
131
139
|
return {
|
|
132
140
|
"wizard_id": self.id,
|
|
@@ -138,8 +146,14 @@ class AgedPartnerBalanceWizard(models.TransientModel):
|
|
|
138
146
|
"partner_ids": self.partner_ids.ids,
|
|
139
147
|
"show_move_line_details": self.show_move_line_details,
|
|
140
148
|
"account_financial_report_lang": self.env.lang,
|
|
149
|
+
"age_partner_config_id": self.age_partner_config_id.id,
|
|
141
150
|
}
|
|
142
151
|
|
|
152
|
+
def _prepare_report_data(self):
|
|
153
|
+
res = super()._prepare_report_data()
|
|
154
|
+
res.update(self._prepare_report_aged_partner_balance())
|
|
155
|
+
return res
|
|
156
|
+
|
|
143
157
|
def _export(self, report_type):
|
|
144
158
|
"""Default export is PDF."""
|
|
145
159
|
return self._print_report(report_type)
|
|
@@ -33,6 +33,8 @@
|
|
|
33
33
|
/>
|
|
34
34
|
</group>
|
|
35
35
|
<group name="account_filter" col="4">
|
|
36
|
+
<label for="age_partner_config_id" />
|
|
37
|
+
<field name="age_partner_config_id" nolabel="1" />
|
|
36
38
|
<label for="account_ids" colspan="4" />
|
|
37
39
|
<field name="receivable_accounts_only" />
|
|
38
40
|
<field name="payable_accounts_only" />
|
|
@@ -68,19 +70,16 @@
|
|
|
68
70
|
default_focus="1"
|
|
69
71
|
class="oe_highlight"
|
|
70
72
|
/>
|
|
71
|
-
or
|
|
72
73
|
<button
|
|
73
74
|
name="button_export_pdf"
|
|
74
75
|
string="Export PDF"
|
|
75
76
|
type="object"
|
|
76
77
|
/>
|
|
77
|
-
or
|
|
78
78
|
<button
|
|
79
79
|
name="button_export_xlsx"
|
|
80
80
|
string="Export XLSX"
|
|
81
81
|
type="object"
|
|
82
82
|
/>
|
|
83
|
-
or
|
|
84
83
|
<button string="Cancel" class="oe_link" special="cancel" />
|
|
85
84
|
</footer>
|
|
86
85
|
</form>
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
import time
|
|
11
11
|
from ast import literal_eval
|
|
12
12
|
|
|
13
|
-
from odoo import
|
|
13
|
+
from odoo import api, fields, models
|
|
14
14
|
from odoo.exceptions import ValidationError
|
|
15
15
|
from odoo.tools import date_utils
|
|
16
16
|
|
|
@@ -43,7 +43,6 @@ class GeneralLedgerReportWizard(models.TransientModel):
|
|
|
43
43
|
"If partners are filtered, "
|
|
44
44
|
"debits and credits totals will not match the trial balance.",
|
|
45
45
|
)
|
|
46
|
-
show_analytic_tags = fields.Boolean()
|
|
47
46
|
receivable_accounts_only = fields.Boolean()
|
|
48
47
|
payable_accounts_only = fields.Boolean()
|
|
49
48
|
partner_ids = fields.Many2many(
|
|
@@ -51,17 +50,16 @@ class GeneralLedgerReportWizard(models.TransientModel):
|
|
|
51
50
|
string="Filter partners",
|
|
52
51
|
default=lambda self: self._default_partners(),
|
|
53
52
|
)
|
|
54
|
-
analytic_tag_ids = fields.Many2many(
|
|
55
|
-
comodel_name="account.analytic.tag", string="Filter analytic tags"
|
|
56
|
-
)
|
|
57
53
|
account_journal_ids = fields.Many2many(
|
|
58
54
|
comodel_name="account.journal", string="Filter journals"
|
|
59
55
|
)
|
|
60
56
|
cost_center_ids = fields.Many2many(
|
|
61
57
|
comodel_name="account.analytic.account", string="Filter cost centers"
|
|
62
58
|
)
|
|
63
|
-
|
|
64
|
-
|
|
59
|
+
only_one_unaffected_earnings_account = fields.Boolean(
|
|
60
|
+
readonly=True,
|
|
61
|
+
default=lambda self: self._only_one_unaffected_earnings_account(),
|
|
62
|
+
)
|
|
65
63
|
foreign_currency = fields.Boolean(
|
|
66
64
|
string="Show foreign currency",
|
|
67
65
|
help="Display foreign currency for move lines, unless "
|
|
@@ -77,8 +75,10 @@ class GeneralLedgerReportWizard(models.TransientModel):
|
|
|
77
75
|
comodel_name="account.account",
|
|
78
76
|
help="Ending account in a range",
|
|
79
77
|
)
|
|
80
|
-
|
|
81
|
-
|
|
78
|
+
grouped_by = fields.Selection(
|
|
79
|
+
selection=[("none", "None"), ("partners", "Partners"), ("taxes", "Taxes")],
|
|
80
|
+
default="partners",
|
|
81
|
+
required=True,
|
|
82
82
|
)
|
|
83
83
|
show_cost_center = fields.Boolean(
|
|
84
84
|
string="Show Analytic Account",
|
|
@@ -104,13 +104,10 @@ class GeneralLedgerReportWizard(models.TransientModel):
|
|
|
104
104
|
):
|
|
105
105
|
start_range = int(self.account_code_from.code)
|
|
106
106
|
end_range = int(self.account_code_to.code)
|
|
107
|
-
|
|
108
|
-
[("code", ">=", start_range), ("code", "<=", end_range)]
|
|
109
|
-
)
|
|
107
|
+
domain = [("code", ">=", start_range), ("code", "<=", end_range)]
|
|
110
108
|
if self.company_id:
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
)
|
|
109
|
+
domain.append(("company_ids", "in", self.company_id.ids))
|
|
110
|
+
self.account_ids = self.env["account.account"].search(domain)
|
|
114
111
|
|
|
115
112
|
def _init_date_from(self):
|
|
116
113
|
"""set start date to begin of current year if fiscal year running"""
|
|
@@ -144,17 +141,21 @@ class GeneralLedgerReportWizard(models.TransientModel):
|
|
|
144
141
|
else:
|
|
145
142
|
wiz.fy_start_date = False
|
|
146
143
|
|
|
147
|
-
|
|
148
|
-
def onchange_company_id(self):
|
|
149
|
-
"""Handle company change."""
|
|
150
|
-
account_type = self.env.ref("account.data_unaffected_earnings")
|
|
144
|
+
def _only_one_unaffected_earnings_account(self):
|
|
151
145
|
count = self.env["account.account"].search_count(
|
|
152
146
|
[
|
|
153
|
-
("
|
|
154
|
-
("
|
|
147
|
+
("account_type", "=", "equity_unaffected"),
|
|
148
|
+
("company_ids", "in", [self.company_id.id or self.env.company.id]),
|
|
155
149
|
]
|
|
156
150
|
)
|
|
157
|
-
|
|
151
|
+
return count == 1
|
|
152
|
+
|
|
153
|
+
@api.onchange("company_id")
|
|
154
|
+
def onchange_company_id(self):
|
|
155
|
+
"""Handle company change."""
|
|
156
|
+
self.only_one_unaffected_earnings_account = (
|
|
157
|
+
self._only_one_unaffected_earnings_account()
|
|
158
|
+
)
|
|
158
159
|
if (
|
|
159
160
|
self.company_id
|
|
160
161
|
and self.date_range_id.company_id
|
|
@@ -174,7 +175,7 @@ class GeneralLedgerReportWizard(models.TransientModel):
|
|
|
174
175
|
self.onchange_type_accounts_only()
|
|
175
176
|
else:
|
|
176
177
|
self.account_ids = self.account_ids.filtered(
|
|
177
|
-
lambda a:
|
|
178
|
+
lambda a: self.company_id in a.company_ids
|
|
178
179
|
)
|
|
179
180
|
if self.company_id and self.cost_center_ids:
|
|
180
181
|
self.cost_center_ids = self.cost_center_ids.filtered(
|
|
@@ -192,7 +193,7 @@ class GeneralLedgerReportWizard(models.TransientModel):
|
|
|
192
193
|
if not self.company_id:
|
|
193
194
|
return res
|
|
194
195
|
else:
|
|
195
|
-
res["domain"]["account_ids"] += [("
|
|
196
|
+
res["domain"]["account_ids"] += [("company_ids", "in", self.company_id.ids)]
|
|
196
197
|
res["domain"]["account_journal_ids"] += [
|
|
197
198
|
("company_id", "=", self.company_id.id)
|
|
198
199
|
]
|
|
@@ -223,7 +224,7 @@ class GeneralLedgerReportWizard(models.TransientModel):
|
|
|
223
224
|
and rec.company_id != rec.date_range_id.company_id
|
|
224
225
|
):
|
|
225
226
|
raise ValidationError(
|
|
226
|
-
_(
|
|
227
|
+
self.env._(
|
|
227
228
|
"The Company in the General Ledger Report Wizard and in "
|
|
228
229
|
"Date Range must be the same."
|
|
229
230
|
)
|
|
@@ -233,13 +234,15 @@ class GeneralLedgerReportWizard(models.TransientModel):
|
|
|
233
234
|
def onchange_type_accounts_only(self):
|
|
234
235
|
"""Handle receivable/payable accounts only change."""
|
|
235
236
|
if self.receivable_accounts_only or self.payable_accounts_only:
|
|
236
|
-
domain = [("
|
|
237
|
+
domain = [("company_ids", "in", [self.company_id.id])]
|
|
237
238
|
if self.receivable_accounts_only and self.payable_accounts_only:
|
|
238
|
-
domain += [
|
|
239
|
+
domain += [
|
|
240
|
+
("account_type", "in", ("asset_receivable", "liability_payable"))
|
|
241
|
+
]
|
|
239
242
|
elif self.receivable_accounts_only:
|
|
240
|
-
domain += [("
|
|
243
|
+
domain += [("account_type", "=", "asset_receivable")]
|
|
241
244
|
elif self.payable_accounts_only:
|
|
242
|
-
domain += [("
|
|
245
|
+
domain += [("account_type", "=", "liability_payable")]
|
|
243
246
|
self.account_ids = self.env["account.account"].search(domain)
|
|
244
247
|
else:
|
|
245
248
|
self.account_ids = None
|
|
@@ -254,12 +257,11 @@ class GeneralLedgerReportWizard(models.TransientModel):
|
|
|
254
257
|
|
|
255
258
|
@api.depends("company_id")
|
|
256
259
|
def _compute_unaffected_earnings_account(self):
|
|
257
|
-
account_type = self.env.ref("account.data_unaffected_earnings")
|
|
258
260
|
for record in self:
|
|
259
261
|
record.unaffected_earnings_account = self.env["account.account"].search(
|
|
260
262
|
[
|
|
261
|
-
("
|
|
262
|
-
("
|
|
263
|
+
("account_type", "=", "equity_unaffected"),
|
|
264
|
+
("company_ids", "in", [record.company_id.id]),
|
|
263
265
|
]
|
|
264
266
|
)
|
|
265
267
|
|
|
@@ -271,7 +273,7 @@ class GeneralLedgerReportWizard(models.TransientModel):
|
|
|
271
273
|
|
|
272
274
|
def _print_report(self, report_type):
|
|
273
275
|
self.ensure_one()
|
|
274
|
-
data = self.
|
|
276
|
+
data = self._prepare_report_data()
|
|
275
277
|
if report_type == "xlsx":
|
|
276
278
|
report_name = "a_f_r.report_general_ledger_xlsx"
|
|
277
279
|
else:
|
|
@@ -286,6 +288,7 @@ class GeneralLedgerReportWizard(models.TransientModel):
|
|
|
286
288
|
)
|
|
287
289
|
|
|
288
290
|
def _prepare_report_general_ledger(self):
|
|
291
|
+
# TODO: Kept for compatibility - To be merged into _prepare_report_data in 19
|
|
289
292
|
self.ensure_one()
|
|
290
293
|
return {
|
|
291
294
|
"wizard_id": self.id,
|
|
@@ -294,14 +297,12 @@ class GeneralLedgerReportWizard(models.TransientModel):
|
|
|
294
297
|
"only_posted_moves": self.target_move == "posted",
|
|
295
298
|
"hide_account_at_0": self.hide_account_at_0,
|
|
296
299
|
"foreign_currency": self.foreign_currency,
|
|
297
|
-
"show_analytic_tags": self.show_analytic_tags,
|
|
298
300
|
"company_id": self.company_id.id,
|
|
299
301
|
"account_ids": self.account_ids.ids,
|
|
300
302
|
"partner_ids": self.partner_ids.ids,
|
|
301
|
-
"
|
|
303
|
+
"grouped_by": self.grouped_by,
|
|
302
304
|
"cost_center_ids": self.cost_center_ids.ids,
|
|
303
305
|
"show_cost_center": self.show_cost_center,
|
|
304
|
-
"analytic_tag_ids": self.analytic_tag_ids.ids,
|
|
305
306
|
"journal_ids": self.account_journal_ids.ids,
|
|
306
307
|
"centralize": self.centralize,
|
|
307
308
|
"fy_start_date": self.fy_start_date,
|
|
@@ -310,6 +311,11 @@ class GeneralLedgerReportWizard(models.TransientModel):
|
|
|
310
311
|
"domain": self._get_account_move_lines_domain(),
|
|
311
312
|
}
|
|
312
313
|
|
|
314
|
+
def _prepare_report_data(self):
|
|
315
|
+
res = super()._prepare_report_data()
|
|
316
|
+
res.update(self._prepare_report_general_ledger())
|
|
317
|
+
return res
|
|
318
|
+
|
|
313
319
|
def _export(self, report_type):
|
|
314
320
|
"""Default export is PDF."""
|
|
315
321
|
return self._print_report(report_type)
|
|
@@ -13,23 +13,20 @@
|
|
|
13
13
|
groups="base.group_multi_company"
|
|
14
14
|
/>
|
|
15
15
|
</group>
|
|
16
|
-
<div
|
|
17
|
-
attrs="{'invisible': [('not_only_one_unaffected_earnings_account', '=', True)]}"
|
|
18
|
-
>
|
|
16
|
+
<div invisible="not only_one_unaffected_earnings_account">
|
|
19
17
|
<group name="filters">
|
|
20
18
|
<group name="date_range">
|
|
21
19
|
<field name="date_range_id" />
|
|
22
20
|
<field name="date_from" />
|
|
23
21
|
<field name="date_to" />
|
|
24
22
|
<field name="fy_start_date" invisible="1" />
|
|
23
|
+
<field name="target_move" widget="radio" />
|
|
25
24
|
</group>
|
|
26
25
|
<group name="other_filters">
|
|
27
|
-
<field name="
|
|
26
|
+
<field name="grouped_by" />
|
|
28
27
|
<field name="centralize" />
|
|
29
|
-
<field name="show_partner_details" />
|
|
30
28
|
<field name="hide_account_at_0" />
|
|
31
29
|
<field name="foreign_currency" />
|
|
32
|
-
<field name="show_analytic_tags" />
|
|
33
30
|
<field name="show_cost_center" />
|
|
34
31
|
</group>
|
|
35
32
|
</group>
|
|
@@ -83,14 +80,6 @@
|
|
|
83
80
|
options="{'no_create': True}"
|
|
84
81
|
/>
|
|
85
82
|
</page>
|
|
86
|
-
<page string="Filter analytic tags">
|
|
87
|
-
<field
|
|
88
|
-
name="analytic_tag_ids"
|
|
89
|
-
widget="many2many_tags"
|
|
90
|
-
nolabel="1"
|
|
91
|
-
options="{'no_create': True}"
|
|
92
|
-
/>
|
|
93
|
-
</page>
|
|
94
83
|
<page string="Additional Filtering">
|
|
95
84
|
<style>
|
|
96
85
|
.o_domain_show_selection_button {display: none}
|
|
@@ -102,15 +91,15 @@
|
|
|
102
91
|
context="{'skip_search_count': 1}"
|
|
103
92
|
/>
|
|
104
93
|
</page>
|
|
94
|
+
<page name="format" string="Format">
|
|
95
|
+
<group>
|
|
96
|
+
<field name="label_text_limit" />
|
|
97
|
+
</group>
|
|
98
|
+
</page>
|
|
105
99
|
</notebook>
|
|
106
100
|
</div>
|
|
107
|
-
<div
|
|
108
|
-
|
|
109
|
-
>
|
|
110
|
-
<field
|
|
111
|
-
name="not_only_one_unaffected_earnings_account"
|
|
112
|
-
invisible="1"
|
|
113
|
-
/>
|
|
101
|
+
<div invisible="only_one_unaffected_earnings_account">
|
|
102
|
+
<field name="only_one_unaffected_earnings_account" invisible="1" />
|
|
114
103
|
<group />
|
|
115
104
|
<h4>
|
|
116
105
|
General Ledger can be computed only if selected company have
|
|
@@ -119,34 +108,30 @@
|
|
|
119
108
|
<group />
|
|
120
109
|
</div>
|
|
121
110
|
<footer>
|
|
122
|
-
<div
|
|
123
|
-
attrs="{'invisible': [('not_only_one_unaffected_earnings_account', '=', True)]}"
|
|
124
|
-
>
|
|
111
|
+
<div invisible="not only_one_unaffected_earnings_account">
|
|
125
112
|
<button
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
113
|
+
name="button_export_html"
|
|
114
|
+
string="View"
|
|
115
|
+
type="object"
|
|
116
|
+
default_focus="1"
|
|
117
|
+
class="oe_highlight"
|
|
118
|
+
/>
|
|
132
119
|
or
|
|
133
120
|
<button
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
121
|
+
name="button_export_pdf"
|
|
122
|
+
string="Export PDF"
|
|
123
|
+
type="object"
|
|
124
|
+
/>
|
|
138
125
|
or
|
|
139
126
|
<button
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
127
|
+
name="button_export_xlsx"
|
|
128
|
+
string="Export XLSX"
|
|
129
|
+
type="object"
|
|
130
|
+
/>
|
|
144
131
|
or
|
|
145
132
|
<button string="Cancel" class="oe_link" special="cancel" />
|
|
146
133
|
</div>
|
|
147
|
-
<div
|
|
148
|
-
attrs="{'invisible': [('not_only_one_unaffected_earnings_account', '=', False)]}"
|
|
149
|
-
>
|
|
134
|
+
<div invisible="only_one_unaffected_earnings_account">
|
|
150
135
|
<button string="Cancel" class="oe_link" special="cancel" />
|
|
151
136
|
</div>
|
|
152
137
|
</footer>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Copyright 2017 ACSONE SA/NV
|
|
2
2
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
|
3
3
|
|
|
4
|
-
from odoo import
|
|
4
|
+
from odoo import api, fields, models
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
class JournalLedgerReportWizard(models.TransientModel):
|
|
@@ -38,15 +38,19 @@ class JournalLedgerReportWizard(models.TransientModel):
|
|
|
38
38
|
|
|
39
39
|
@api.model
|
|
40
40
|
def _get_move_targets(self):
|
|
41
|
-
return [
|
|
41
|
+
return [
|
|
42
|
+
("all", self.env._("All")),
|
|
43
|
+
("posted", self.env._("Posted")),
|
|
44
|
+
("draft", self.env._("Not Posted")),
|
|
45
|
+
]
|
|
42
46
|
|
|
43
47
|
@api.model
|
|
44
48
|
def _get_sort_options(self):
|
|
45
|
-
return [("move_name", _("Entry number")), ("date", _("Date"))]
|
|
49
|
+
return [("move_name", self.env._("Entry number")), ("date", self.env._("Date"))]
|
|
46
50
|
|
|
47
51
|
@api.model
|
|
48
52
|
def _get_group_options(self):
|
|
49
|
-
return [("journal", _("Journal")), ("none", _("No group"))]
|
|
53
|
+
return [("journal", self.env._("Journal")), ("none", self.env._("No group"))]
|
|
50
54
|
|
|
51
55
|
@api.onchange("date_range_id")
|
|
52
56
|
def onchange_date_range_id(self):
|
|
@@ -75,7 +79,7 @@ class JournalLedgerReportWizard(models.TransientModel):
|
|
|
75
79
|
|
|
76
80
|
def _print_report(self, report_type):
|
|
77
81
|
self.ensure_one()
|
|
78
|
-
data = self.
|
|
82
|
+
data = self._prepare_report_data()
|
|
79
83
|
if report_type == "xlsx":
|
|
80
84
|
report_name = "a_f_r.report_journal_ledger_xlsx"
|
|
81
85
|
else:
|
|
@@ -90,12 +94,15 @@ class JournalLedgerReportWizard(models.TransientModel):
|
|
|
90
94
|
)
|
|
91
95
|
|
|
92
96
|
def _prepare_report_journal_ledger(self):
|
|
97
|
+
# TODO: Kept for compatibility - To be merged into _prepare_report_data in 19
|
|
93
98
|
self.ensure_one()
|
|
94
99
|
journals = self.journal_ids
|
|
95
100
|
if not journals:
|
|
96
101
|
# Not selecting a journal means that we'll display all journals
|
|
97
|
-
journals =
|
|
98
|
-
[
|
|
102
|
+
journals = (
|
|
103
|
+
self.env["account.journal"]
|
|
104
|
+
.with_context(active_test=False)
|
|
105
|
+
.search([("company_id", "=", self.company_id.id)])
|
|
99
106
|
)
|
|
100
107
|
return {
|
|
101
108
|
"wizard_id": self.id,
|
|
@@ -112,6 +119,11 @@ class JournalLedgerReportWizard(models.TransientModel):
|
|
|
112
119
|
"with_auto_sequence": self.with_auto_sequence,
|
|
113
120
|
}
|
|
114
121
|
|
|
122
|
+
def _prepare_report_data(self):
|
|
123
|
+
res = super()._prepare_report_data()
|
|
124
|
+
res.update(self._prepare_report_journal_ledger())
|
|
125
|
+
return res
|
|
126
|
+
|
|
115
127
|
def _export(self, report_type):
|
|
116
128
|
"""Default export is PDF."""
|
|
117
129
|
self.ensure_one()
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
<field name="foreign_currency" />
|
|
33
33
|
<field name="with_account_name" />
|
|
34
34
|
<field name="with_auto_sequence" />
|
|
35
|
+
<field name="label_text_limit" />
|
|
35
36
|
</group>
|
|
36
37
|
<group />
|
|
37
38
|
</group>
|
|
@@ -41,24 +42,24 @@
|
|
|
41
42
|
</group>
|
|
42
43
|
<footer>
|
|
43
44
|
<button
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
45
|
+
name="button_export_html"
|
|
46
|
+
string="View"
|
|
47
|
+
type="object"
|
|
48
|
+
default_focus="1"
|
|
49
|
+
class="oe_highlight"
|
|
50
|
+
/>
|
|
50
51
|
or
|
|
51
52
|
<button
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
name="button_export_pdf"
|
|
54
|
+
string="Export PDF"
|
|
55
|
+
type="object"
|
|
56
|
+
/>
|
|
56
57
|
or
|
|
57
58
|
<button
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
name="button_export_xlsx"
|
|
60
|
+
string="Export XLSX"
|
|
61
|
+
type="object"
|
|
62
|
+
/>
|
|
62
63
|
or
|
|
63
64
|
<button string="Cancel" class="oe_link" special="cancel" />
|
|
64
65
|
</footer>
|