[MIG] account_financial_report: Migration to 15.0
parent
f681061d54
commit
da42c86e1d
|
@ -6,7 +6,7 @@
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
||||||
{
|
{
|
||||||
"name": "Account Financial Reports",
|
"name": "Account Financial Reports",
|
||||||
"version": "14.0.2.0.1",
|
"version": "15.0.1.0.0",
|
||||||
"category": "Reporting",
|
"category": "Reporting",
|
||||||
"summary": "OCA Financial Reports",
|
"summary": "OCA Financial Reports",
|
||||||
"author": "Camptocamp SA,"
|
"author": "Camptocamp SA,"
|
||||||
|
@ -34,7 +34,6 @@
|
||||||
"report/templates/trial_balance.xml",
|
"report/templates/trial_balance.xml",
|
||||||
"report/templates/vat_report.xml",
|
"report/templates/vat_report.xml",
|
||||||
"view/account_view.xml",
|
"view/account_view.xml",
|
||||||
"view/report_template.xml",
|
|
||||||
"view/report_general_ledger.xml",
|
"view/report_general_ledger.xml",
|
||||||
"view/report_journal_ledger.xml",
|
"view/report_journal_ledger.xml",
|
||||||
"view/report_trial_balance.xml",
|
"view/report_trial_balance.xml",
|
||||||
|
@ -42,7 +41,18 @@
|
||||||
"view/report_aged_partner_balance.xml",
|
"view/report_aged_partner_balance.xml",
|
||||||
"view/report_vat_report.xml",
|
"view/report_vat_report.xml",
|
||||||
],
|
],
|
||||||
"qweb": ["static/src/xml/report.xml"],
|
"assets": {
|
||||||
|
"web.assets_backend": [
|
||||||
|
"account_financial_report/static/src/js/action_manager_report.js",
|
||||||
|
"account_financial_report/static/src/js/client_action.js",
|
||||||
|
],
|
||||||
|
"web.report_assets_common": [
|
||||||
|
"account_financial_report/static/src/js/report.js"
|
||||||
|
],
|
||||||
|
"web.assets_qweb": [
|
||||||
|
"account_financial_report/static/src/xml/**/*",
|
||||||
|
],
|
||||||
|
},
|
||||||
"installable": True,
|
"installable": True,
|
||||||
"application": True,
|
"application": True,
|
||||||
"auto_install": False,
|
"auto_install": False,
|
||||||
|
|
|
@ -1136,7 +1136,7 @@ msgstr "المستوى"
|
||||||
#: code:addons/account_financial_report/report/trial_balance_xlsx.py:0
|
#: code:addons/account_financial_report/report/trial_balance_xlsx.py:0
|
||||||
#, fuzzy, python-format
|
#, fuzzy, python-format
|
||||||
msgid "Level %s"
|
msgid "Level %s"
|
||||||
msgstr "المستوى"
|
msgstr "المستوى %s"
|
||||||
|
|
||||||
#. module: account_financial_report
|
#. module: account_financial_report
|
||||||
#: code:addons/account_financial_report/report/trial_balance_xlsx.py:0
|
#: code:addons/account_financial_report/report/trial_balance_xlsx.py:0
|
||||||
|
|
|
@ -7,7 +7,6 @@ class AccountAccount(models.Model):
|
||||||
_inherit = "account.account"
|
_inherit = "account.account"
|
||||||
|
|
||||||
centralized = fields.Boolean(
|
centralized = fields.Boolean(
|
||||||
"Centralized",
|
|
||||||
help="If flagged, no details will be displayed in "
|
help="If flagged, no details will be displayed in "
|
||||||
"the General Ledger report (the webkit one only), "
|
"the General Ledger report (the webkit one only), "
|
||||||
"only centralized amounts per period.",
|
"only centralized amounts per period.",
|
||||||
|
|
|
@ -10,7 +10,7 @@ class AccountGroup(models.Model):
|
||||||
group_child_ids = fields.One2many(
|
group_child_ids = fields.One2many(
|
||||||
comodel_name="account.group", inverse_name="parent_id", string="Child Groups"
|
comodel_name="account.group", inverse_name="parent_id", string="Child Groups"
|
||||||
)
|
)
|
||||||
level = fields.Integer(string="Level", compute="_compute_level")
|
level = fields.Integer(compute="_compute_level", recursive=True)
|
||||||
account_ids = fields.One2many(
|
account_ids = fields.One2many(
|
||||||
comodel_name="account.account", inverse_name="group_id", string="Accounts"
|
comodel_name="account.account", inverse_name="group_id", string="Accounts"
|
||||||
)
|
)
|
||||||
|
@ -20,8 +20,12 @@ class AccountGroup(models.Model):
|
||||||
string="Compute accounts",
|
string="Compute accounts",
|
||||||
store=True,
|
store=True,
|
||||||
)
|
)
|
||||||
complete_name = fields.Char("Full Name", compute="_compute_complete_name")
|
complete_name = fields.Char(
|
||||||
complete_code = fields.Char("Full Code", compute="_compute_complete_code")
|
"Full Name", compute="_compute_complete_name", recursive=True
|
||||||
|
)
|
||||||
|
complete_code = fields.Char(
|
||||||
|
"Full Code", compute="_compute_complete_code", recursive=True
|
||||||
|
)
|
||||||
|
|
||||||
@api.depends("name", "parent_id.complete_name")
|
@api.depends("name", "parent_id.complete_name")
|
||||||
def _compute_complete_name(self):
|
def _compute_complete_name(self):
|
||||||
|
|
|
@ -15,11 +15,11 @@ class IrActionsReport(models.Model):
|
||||||
@api.model
|
@api.model
|
||||||
def _render_qweb_html(self, docids, data=None):
|
def _render_qweb_html(self, docids, data=None):
|
||||||
context = self._prepare_account_financial_report_context(data)
|
context = self._prepare_account_financial_report_context(data)
|
||||||
obj = self.with_context(context) if context else self
|
obj = self.with_context(**context) if context else self
|
||||||
return super(IrActionsReport, obj)._render_qweb_html(docids, data)
|
return super(IrActionsReport, obj)._render_qweb_html(docids, data)
|
||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
def _render_xlsx(self, docids, data):
|
def _render_xlsx(self, docids, data):
|
||||||
context = self._prepare_account_financial_report_context(data)
|
context = self._prepare_account_financial_report_context(data)
|
||||||
obj = self.with_context(context) if context else self
|
obj = self.with_context(**context) if context else self
|
||||||
return super(IrActionsReport, obj)._render_xlsx(docids, data)
|
return super(IrActionsReport, obj)._render_xlsx(docids, data)
|
||||||
|
|
|
@ -40,7 +40,7 @@ class AgedPartnerBalanceXslx(models.AbstractModel):
|
||||||
"width": 14,
|
"width": 14,
|
||||||
},
|
},
|
||||||
3: {
|
3: {
|
||||||
"header": _(u"Age ≤ 30 d."),
|
"header": _("Age ≤ 30 d."),
|
||||||
"field": "30_days",
|
"field": "30_days",
|
||||||
"field_footer_total": "30_days",
|
"field_footer_total": "30_days",
|
||||||
"field_footer_percent": "percent_30_days",
|
"field_footer_percent": "percent_30_days",
|
||||||
|
@ -48,7 +48,7 @@ class AgedPartnerBalanceXslx(models.AbstractModel):
|
||||||
"width": 14,
|
"width": 14,
|
||||||
},
|
},
|
||||||
4: {
|
4: {
|
||||||
"header": _(u"Age ≤ 60 d."),
|
"header": _("Age ≤ 60 d."),
|
||||||
"field": "60_days",
|
"field": "60_days",
|
||||||
"field_footer_total": "60_days",
|
"field_footer_total": "60_days",
|
||||||
"field_footer_percent": "percent_60_days",
|
"field_footer_percent": "percent_60_days",
|
||||||
|
@ -56,7 +56,7 @@ class AgedPartnerBalanceXslx(models.AbstractModel):
|
||||||
"width": 14,
|
"width": 14,
|
||||||
},
|
},
|
||||||
5: {
|
5: {
|
||||||
"header": _(u"Age ≤ 90 d."),
|
"header": _("Age ≤ 90 d."),
|
||||||
"field": "90_days",
|
"field": "90_days",
|
||||||
"field_footer_total": "90_days",
|
"field_footer_total": "90_days",
|
||||||
"field_footer_percent": "percent_90_days",
|
"field_footer_percent": "percent_90_days",
|
||||||
|
@ -64,7 +64,7 @@ class AgedPartnerBalanceXslx(models.AbstractModel):
|
||||||
"width": 14,
|
"width": 14,
|
||||||
},
|
},
|
||||||
6: {
|
6: {
|
||||||
"header": _(u"Age ≤ 120 d."),
|
"header": _("Age ≤ 120 d."),
|
||||||
"field": "120_days",
|
"field": "120_days",
|
||||||
"field_footer_total": "120_days",
|
"field_footer_total": "120_days",
|
||||||
"field_footer_percent": "percent_120_days",
|
"field_footer_percent": "percent_120_days",
|
||||||
|
@ -106,7 +106,7 @@ class AgedPartnerBalanceXslx(models.AbstractModel):
|
||||||
"width": 14,
|
"width": 14,
|
||||||
},
|
},
|
||||||
9: {
|
9: {
|
||||||
"header": _(u"Age ≤ 30 d."),
|
"header": _("Age ≤ 30 d."),
|
||||||
"field": "30_days",
|
"field": "30_days",
|
||||||
"field_footer_total": "30_days",
|
"field_footer_total": "30_days",
|
||||||
"field_footer_percent": "percent_30_days",
|
"field_footer_percent": "percent_30_days",
|
||||||
|
@ -115,7 +115,7 @@ class AgedPartnerBalanceXslx(models.AbstractModel):
|
||||||
"width": 14,
|
"width": 14,
|
||||||
},
|
},
|
||||||
10: {
|
10: {
|
||||||
"header": _(u"Age ≤ 60 d."),
|
"header": _("Age ≤ 60 d."),
|
||||||
"field": "60_days",
|
"field": "60_days",
|
||||||
"field_footer_total": "60_days",
|
"field_footer_total": "60_days",
|
||||||
"field_footer_percent": "percent_60_days",
|
"field_footer_percent": "percent_60_days",
|
||||||
|
@ -124,7 +124,7 @@ class AgedPartnerBalanceXslx(models.AbstractModel):
|
||||||
"width": 14,
|
"width": 14,
|
||||||
},
|
},
|
||||||
11: {
|
11: {
|
||||||
"header": _(u"Age ≤ 90 d."),
|
"header": _("Age ≤ 90 d."),
|
||||||
"field": "90_days",
|
"field": "90_days",
|
||||||
"field_footer_total": "90_days",
|
"field_footer_total": "90_days",
|
||||||
"field_footer_percent": "percent_90_days",
|
"field_footer_percent": "percent_90_days",
|
||||||
|
@ -133,7 +133,7 @@ class AgedPartnerBalanceXslx(models.AbstractModel):
|
||||||
"width": 14,
|
"width": 14,
|
||||||
},
|
},
|
||||||
12: {
|
12: {
|
||||||
"header": _(u"Age ≤ 120 d."),
|
"header": _("Age ≤ 120 d."),
|
||||||
"field": "120_days",
|
"field": "120_days",
|
||||||
"field_footer_total": "120_days",
|
"field_footer_total": "120_days",
|
||||||
"field_footer_percent": "percent_120_days",
|
"field_footer_percent": "percent_120_days",
|
||||||
|
@ -282,7 +282,9 @@ class AgedPartnerBalanceXslx(models.AbstractModel):
|
||||||
"""
|
"""
|
||||||
name = None
|
name = None
|
||||||
label = _("Partner cumul aged balance")
|
label = _("Partner cumul aged balance")
|
||||||
super().write_ending_balance_from_dict(my_object, name, label, report_data)
|
return super().write_ending_balance_from_dict(
|
||||||
|
my_object, name, label, report_data
|
||||||
|
)
|
||||||
|
|
||||||
def write_account_footer_from_dict(
|
def write_account_footer_from_dict(
|
||||||
self,
|
self,
|
||||||
|
|
|
@ -97,7 +97,8 @@ class GeneralLedgerXslx(models.AbstractModel):
|
||||||
return [
|
return [
|
||||||
[
|
[
|
||||||
_("Date range filter"),
|
_("Date range filter"),
|
||||||
_("From: %s To: %s") % (report.date_from, report.date_to),
|
_("From: %(date_from)s To: %(date_to)s")
|
||||||
|
% ({"date_from": report.date_from, "date_to": report.date_to}),
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
_("Target moves filter"),
|
_("Target moves filter"),
|
||||||
|
@ -329,7 +330,7 @@ class GeneralLedgerXslx(models.AbstractModel):
|
||||||
label = _("Partner Initial balance")
|
label = _("Partner Initial balance")
|
||||||
elif "account" in my_object["type"]:
|
elif "account" in my_object["type"]:
|
||||||
label = _("Initial balance")
|
label = _("Initial balance")
|
||||||
super(GeneralLedgerXslx, self).write_initial_balance_from_dict(
|
return super(GeneralLedgerXslx, self).write_initial_balance_from_dict(
|
||||||
my_object, label, report_data
|
my_object, label, report_data
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -341,6 +342,6 @@ class GeneralLedgerXslx(models.AbstractModel):
|
||||||
elif "account" in my_object["type"]:
|
elif "account" in my_object["type"]:
|
||||||
name = my_object["code"] + " - " + my_object["name"]
|
name = my_object["code"] + " - " + my_object["name"]
|
||||||
label = _("Ending balance")
|
label = _("Ending balance")
|
||||||
super(GeneralLedgerXslx, self).write_ending_balance_from_dict(
|
return super(GeneralLedgerXslx, self).write_ending_balance_from_dict(
|
||||||
my_object, name, label, report_data
|
my_object, name, label, report_data
|
||||||
)
|
)
|
||||||
|
|
|
@ -86,11 +86,11 @@ class JournalLedgerReport(models.AbstractModel):
|
||||||
def _get_move_lines_order(self, move_ids, wizard, journal_ids):
|
def _get_move_lines_order(self, move_ids, wizard, journal_ids):
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
def _get_move_lines_data(self, ml, wizard, ml_taxes, auto_sequence):
|
def _get_move_lines_data(self, ml, wizard, ml_taxes, auto_sequence, exigible):
|
||||||
base_debit = (
|
base_debit = (
|
||||||
base_credit
|
base_credit
|
||||||
) = tax_debit = tax_credit = base_balance = tax_balance = 0.0
|
) = tax_debit = tax_credit = base_balance = tax_balance = 0.0
|
||||||
if ml.tax_exigible:
|
if exigible:
|
||||||
base_debit = ml_taxes and ml.debit or 0.0
|
base_debit = ml_taxes and ml.debit or 0.0
|
||||||
base_credit = ml_taxes and ml.credit or 0.0
|
base_credit = ml_taxes and ml.credit or 0.0
|
||||||
base_balance = ml_taxes and ml.balance or 0.0
|
base_balance = ml_taxes and ml.balance or 0.0
|
||||||
|
@ -179,6 +179,10 @@ class JournalLedgerReport(models.AbstractModel):
|
||||||
self._get_move_lines_domain(move_ids, wizard, journal_ids),
|
self._get_move_lines_domain(move_ids, wizard, journal_ids),
|
||||||
order=self._get_move_lines_order(move_ids, wizard, journal_ids),
|
order=self._get_move_lines_order(move_ids, wizard, journal_ids),
|
||||||
)
|
)
|
||||||
|
move_lines_exigible = self.env["account.move.line"].search(
|
||||||
|
self._get_move_lines_domain(move_ids, wizard, journal_ids)
|
||||||
|
+ self.env["account.move.line"]._get_tax_exigible_domain(),
|
||||||
|
)
|
||||||
move_line_ids_taxes_data = {}
|
move_line_ids_taxes_data = {}
|
||||||
if move_lines:
|
if move_lines:
|
||||||
# Get the taxes ids for the move lines
|
# Get the taxes ids for the move lines
|
||||||
|
@ -221,8 +225,9 @@ class JournalLedgerReport(models.AbstractModel):
|
||||||
and move_line_ids_taxes_data[ml.id]
|
and move_line_ids_taxes_data[ml.id]
|
||||||
or {}
|
or {}
|
||||||
)
|
)
|
||||||
|
exigible = ml in move_lines_exigible
|
||||||
Move_Lines[ml.move_id.id].append(
|
Move_Lines[ml.move_id.id].append(
|
||||||
self._get_move_lines_data(ml, wizard, taxes, auto_sequence)
|
self._get_move_lines_data(ml, wizard, taxes, auto_sequence, exigible)
|
||||||
)
|
)
|
||||||
account_ids_data = self._get_account_data(accounts)
|
account_ids_data = self._get_account_data(accounts)
|
||||||
partner_ids_data = self._get_partner_data(partners)
|
partner_ids_data = self._get_partner_data(partners)
|
||||||
|
|
|
@ -134,7 +134,8 @@ class JournalLedgerXslx(models.AbstractModel):
|
||||||
[_("Company"), report.company_id.name],
|
[_("Company"), report.company_id.name],
|
||||||
[
|
[
|
||||||
_("Date range filter"),
|
_("Date range filter"),
|
||||||
_("From: %s To: %s") % (report.date_from, report.date_to),
|
_("From: %(date_from)s To: %(date_to)s")
|
||||||
|
% ({"date_from": report.date_from, "date_to": report.date_to}),
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
_("Target moves filter"),
|
_("Target moves filter"),
|
||||||
|
|
|
@ -211,6 +211,6 @@ class OpenItemsXslx(models.AbstractModel):
|
||||||
name = my_object["code"] + " - " + my_object["name"]
|
name = my_object["code"] + " - " + my_object["name"]
|
||||||
my_object["residual"] = total_amount[account_id]["residual"]
|
my_object["residual"] = total_amount[account_id]["residual"]
|
||||||
label = _("Ending balance")
|
label = _("Ending balance")
|
||||||
super(OpenItemsXslx, self).write_ending_balance_from_dict(
|
return super(OpenItemsXslx, self).write_ending_balance_from_dict(
|
||||||
my_object, name, label, report_data
|
my_object, name, label, report_data
|
||||||
)
|
)
|
||||||
|
|
|
@ -17,9 +17,9 @@
|
||||||
<!-- Defines global variables used by internal layout -->
|
<!-- Defines global variables used by internal layout -->
|
||||||
<t t-set="title">
|
<t t-set="title">
|
||||||
Aged Partner Balance -
|
Aged Partner Balance -
|
||||||
<t t-raw="company_name" />
|
<t t-out="company_name" />
|
||||||
-
|
-
|
||||||
<t t-raw="currency_name" />
|
<t t-out="currency_name" />
|
||||||
</t>
|
</t>
|
||||||
<div class="page">
|
<div class="page">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
@ -264,7 +264,7 @@
|
||||||
res-model="account.move"
|
res-model="account.move"
|
||||||
view-type="form"
|
view-type="form"
|
||||||
>
|
>
|
||||||
<t t-raw="line['entry']" />
|
<t t-out="line['entry']" />
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<!--## journal-->
|
<!--## journal-->
|
||||||
|
@ -274,7 +274,7 @@
|
||||||
res-model="account.journal"
|
res-model="account.journal"
|
||||||
view-type="form"
|
view-type="form"
|
||||||
>
|
>
|
||||||
<t t-raw="line['journal']" />
|
<t t-out="line['journal']" />
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<!--## account code-->
|
<!--## account code-->
|
||||||
|
@ -284,7 +284,7 @@
|
||||||
res-model="account.account"
|
res-model="account.account"
|
||||||
view-type="form"
|
view-type="form"
|
||||||
>
|
>
|
||||||
<t t-raw="line['account']" />
|
<t t-out="line['account']" />
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<!--## partner-->
|
<!--## partner-->
|
||||||
|
@ -294,7 +294,7 @@
|
||||||
res-model="res.partner"
|
res-model="res.partner"
|
||||||
view-type="form"
|
view-type="form"
|
||||||
>
|
>
|
||||||
<t t-raw="line['partner']" />
|
<t t-out="line['partner']" />
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<!--## ref - label-->
|
<!--## ref - label-->
|
||||||
|
@ -304,7 +304,7 @@
|
||||||
res-model="account.move.line"
|
res-model="account.move.line"
|
||||||
view-type="form"
|
view-type="form"
|
||||||
>
|
>
|
||||||
<t t-raw="line['ref_label']" />
|
<t t-out="line['ref_label']" />
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<!--## date_due-->
|
<!--## date_due-->
|
||||||
|
@ -328,7 +328,7 @@
|
||||||
res-model="account.move.line"
|
res-model="account.move.line"
|
||||||
>
|
>
|
||||||
<t
|
<t
|
||||||
t-raw="line['residual']"
|
t-out="line['residual']"
|
||||||
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
|
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
|
@ -347,7 +347,7 @@
|
||||||
res-model="account.move.line"
|
res-model="account.move.line"
|
||||||
>
|
>
|
||||||
<t
|
<t
|
||||||
t-raw="line['current']"
|
t-out="line['current']"
|
||||||
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
|
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
|
@ -367,7 +367,7 @@
|
||||||
res-model="account.move.line"
|
res-model="account.move.line"
|
||||||
>
|
>
|
||||||
<t
|
<t
|
||||||
t-raw="line['30_days']"
|
t-out="line['30_days']"
|
||||||
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
|
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
|
@ -387,7 +387,7 @@
|
||||||
res-model="account.move.line"
|
res-model="account.move.line"
|
||||||
>
|
>
|
||||||
<t
|
<t
|
||||||
t-raw="line['60_days']"
|
t-out="line['60_days']"
|
||||||
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
|
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
|
@ -407,7 +407,7 @@
|
||||||
res-model="account.move.line"
|
res-model="account.move.line"
|
||||||
>
|
>
|
||||||
<t
|
<t
|
||||||
t-raw="line['90_days']"
|
t-out="line['90_days']"
|
||||||
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
|
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
|
@ -427,7 +427,7 @@
|
||||||
res-model="account.move.line"
|
res-model="account.move.line"
|
||||||
>
|
>
|
||||||
<t
|
<t
|
||||||
t-raw="line['120_days']"
|
t-out="line['120_days']"
|
||||||
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
|
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
|
@ -447,7 +447,7 @@
|
||||||
res-model="account.move.line"
|
res-model="account.move.line"
|
||||||
>
|
>
|
||||||
<t
|
<t
|
||||||
t-raw="line['older']"
|
t-out="line['older']"
|
||||||
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
|
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"
|
||||||
/>
|
/>
|
||||||
</span>
|
</span>
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
href="/account_financial_report/static/src/css/report.css"
|
href="/account_financial_report/static/src/css/report.css"
|
||||||
rel="stylesheet"
|
rel="stylesheet"
|
||||||
/>
|
/>
|
||||||
<t t-raw="0" />
|
<t t-out="0" />
|
||||||
</div>
|
</div>
|
||||||
<div class="footer">
|
<div class="footer">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
|
@ -106,8 +106,7 @@
|
||||||
t-set="domain"
|
t-set="domain"
|
||||||
t-value="[('tax_ids', 'in', tax['id']),
|
t-value="[('tax_ids', 'in', tax['id']),
|
||||||
('date', '>=', date_from),
|
('date', '>=', date_from),
|
||||||
('date', '<=', date_to),
|
('date', '<=', date_to)]+request.env['account.move.line']._get_tax_exigible_domain()"
|
||||||
('tax_exigible', '=', True)]"
|
|
||||||
/>
|
/>
|
||||||
<span
|
<span
|
||||||
t-att-domain="domain"
|
t-att-domain="domain"
|
||||||
|
@ -125,8 +124,7 @@
|
||||||
t-set="domain"
|
t-set="domain"
|
||||||
t-value="[('tax_line_id', '=', tax['id']),
|
t-value="[('tax_line_id', '=', tax['id']),
|
||||||
('date', '>=', date_from),
|
('date', '>=', date_from),
|
||||||
('date', '<=', date_to),
|
('date', '<=', date_to)]+request.env['account.move.line']._get_tax_exigible_domain()"
|
||||||
('tax_exigible', '=', True)]"
|
|
||||||
/>
|
/>
|
||||||
<span
|
<span
|
||||||
t-att-domain="domain"
|
t-att-domain="domain"
|
||||||
|
|
|
@ -144,7 +144,8 @@ class TrialBalanceXslx(models.AbstractModel):
|
||||||
return [
|
return [
|
||||||
[
|
[
|
||||||
_("Date range filter"),
|
_("Date range filter"),
|
||||||
_("From: %s To: %s") % (report.date_from, report.date_to),
|
_("From: %(date_from)s To: %(date_to)s")
|
||||||
|
% ({"date_from": report.date_from, "date_to": report.date_to}),
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
_("Target moves filter"),
|
_("Target moves filter"),
|
||||||
|
@ -162,7 +163,7 @@ class TrialBalanceXslx(models.AbstractModel):
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
_("Limit hierarchy levels"),
|
_("Limit hierarchy levels"),
|
||||||
_("Level %s" % report.show_hierarchy_level)
|
_("Level %s") % (report.show_hierarchy_level)
|
||||||
if report.limit_hierarchy_level
|
if report.limit_hierarchy_level
|
||||||
else _("No limit"),
|
else _("No limit"),
|
||||||
],
|
],
|
||||||
|
@ -277,7 +278,7 @@ class TrialBalanceXslx(models.AbstractModel):
|
||||||
line_object.currency_id = line_object.report_account_id.currency_id
|
line_object.currency_id = line_object.report_account_id.currency_id
|
||||||
elif type_object == "account":
|
elif type_object == "account":
|
||||||
line_object.currency_id = line_object.currency_id
|
line_object.currency_id = line_object.currency_id
|
||||||
super(TrialBalanceXslx, self).write_line(line_object, report_data)
|
return super(TrialBalanceXslx, self).write_line(line_object, report_data)
|
||||||
|
|
||||||
def write_account_footer(self, account, name_value, report_data):
|
def write_account_footer(self, account, name_value, report_data):
|
||||||
"""Specific function to write account footer for Trial Balance"""
|
"""Specific function to write account footer for Trial Balance"""
|
||||||
|
|
|
@ -36,8 +36,7 @@ class VATReport(models.AbstractModel):
|
||||||
("date", ">=", date_from),
|
("date", ">=", date_from),
|
||||||
("date", "<=", date_to),
|
("date", "<=", date_to),
|
||||||
("tax_line_id", "!=", False),
|
("tax_line_id", "!=", False),
|
||||||
("tax_exigible", "=", True),
|
] + self.env["account.move.line"]._get_tax_exigible_domain()
|
||||||
]
|
|
||||||
if only_posted_moves:
|
if only_posted_moves:
|
||||||
domain += [("move_id.state", "=", "posted")]
|
domain += [("move_id.state", "=", "posted")]
|
||||||
else:
|
else:
|
||||||
|
@ -50,8 +49,7 @@ class VATReport(models.AbstractModel):
|
||||||
("company_id", "=", company_id),
|
("company_id", "=", company_id),
|
||||||
("date", ">=", date_from),
|
("date", ">=", date_from),
|
||||||
("date", "<=", date_to),
|
("date", "<=", date_to),
|
||||||
("tax_exigible", "=", True),
|
] + self.env["account.move.line"]._get_tax_exigible_domain()
|
||||||
]
|
|
||||||
if only_posted_moves:
|
if only_posted_moves:
|
||||||
domain += [("move_id.state", "=", "posted")]
|
domain += [("move_id.state", "=", "posted")]
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -1,35 +1,37 @@
|
||||||
odoo.define("account_financial_report.ReportActionManager", function (require) {
|
// Method is available here https://github.com/odoo/odoo/blob/15.0/addons/web/static/src/webclient/actions/action_service.js#L981
|
||||||
"use strict";
|
// TO DO: Check for implement this action inherit
|
||||||
|
// odoo.define("account_financial_report.ReportActionManager", function (require) {
|
||||||
const ActionManager = require("web.ActionManager");
|
// "use strict";
|
||||||
require("web.ReportActionManager");
|
//
|
||||||
|
// const ActionManager = require("web.ActionManager");
|
||||||
ActionManager.include({
|
// require("web.ReportActionManager");
|
||||||
/**
|
//
|
||||||
* @override
|
// ActionManager.include({
|
||||||
*/
|
// /**
|
||||||
_executeReportClientAction: function (action, options) {
|
// * @override
|
||||||
const MODULE_NAME = "account_financial_report";
|
// */
|
||||||
|
// _executeReportClientAction: function (action, options) {
|
||||||
// When 'report_action' is called from the backend, Odoo hardcodes the action tag.
|
// const MODULE_NAME = "account_financial_report";
|
||||||
// We have to make a hack to use our own report controller.
|
//
|
||||||
if (action.report_name.startsWith(`${MODULE_NAME}.`)) {
|
// // When 'report_action' is called from the backend, Odoo hardcodes the action tag.
|
||||||
const urls = this._makeReportUrls(action);
|
// // We have to make a hack to use our own report controller.
|
||||||
const clientActionOptions = _.extend({}, options, {
|
// if (action.report_name.startsWith(`${MODULE_NAME}.`)) {
|
||||||
context: action.context,
|
// const urls = this._makeReportUrls(action);
|
||||||
data: action.data,
|
// const clientActionOptions = _.extend({}, options, {
|
||||||
display_name: action.display_name,
|
// context: action.context,
|
||||||
name: action.name,
|
// data: action.data,
|
||||||
report_file: action.report_file,
|
// display_name: action.display_name,
|
||||||
report_name: action.report_name,
|
// name: action.name,
|
||||||
report_url: urls.html,
|
// report_file: action.report_file,
|
||||||
});
|
// report_name: action.report_name,
|
||||||
return this.doAction(
|
// report_url: urls.html,
|
||||||
"account_financial_report.client_action",
|
// });
|
||||||
clientActionOptions
|
// return this.doAction(
|
||||||
);
|
// "account_financial_report.client_action",
|
||||||
}
|
// clientActionOptions
|
||||||
return this._super.apply(this, arguments);
|
// );
|
||||||
},
|
// }
|
||||||
});
|
// return this._super.apply(this, arguments);
|
||||||
});
|
// },
|
||||||
|
// });
|
||||||
|
// });
|
||||||
|
|
|
@ -689,7 +689,7 @@ class TestGeneralLedgerReport(AccountTestInvoicingCommon):
|
||||||
"active_model": "res.partner",
|
"active_model": "res.partner",
|
||||||
}
|
}
|
||||||
|
|
||||||
wizard = self.env["general.ledger.report.wizard"].with_context(context)
|
wizard = self.env["general.ledger.report.wizard"].with_context(**context)
|
||||||
self.assertEqual(wizard._default_partners(), expected_list)
|
self.assertEqual(wizard._default_partners(), expected_list)
|
||||||
|
|
||||||
def test_validate_date(self):
|
def test_validate_date(self):
|
||||||
|
|
|
@ -24,5 +24,5 @@ class TestOpenItems(AccountTestInvoicingCommon):
|
||||||
"active_model": "res.partner",
|
"active_model": "res.partner",
|
||||||
}
|
}
|
||||||
|
|
||||||
wizard = self.env["open.items.report.wizard"].with_context(context)
|
wizard = self.env["open.items.report.wizard"].with_context(**context)
|
||||||
self.assertEqual(wizard._default_partners(), expected_list)
|
self.assertEqual(wizard._default_partners(), expected_list)
|
||||||
|
|
|
@ -1,31 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8" ?>
|
|
||||||
<odoo>
|
|
||||||
<template
|
|
||||||
id="account_financial_report_assets_backend"
|
|
||||||
name="account_financial_report assets_backend"
|
|
||||||
inherit_id="web.assets_backend"
|
|
||||||
>
|
|
||||||
<xpath expr="." position="inside">
|
|
||||||
<script
|
|
||||||
type="text/javascript"
|
|
||||||
src="/account_financial_report/static/src/js/action_manager_report.js"
|
|
||||||
/>
|
|
||||||
<script
|
|
||||||
type="text/javascript"
|
|
||||||
src="/account_financial_report/static/src/js/client_action.js"
|
|
||||||
/>
|
|
||||||
</xpath>
|
|
||||||
</template>
|
|
||||||
<template
|
|
||||||
id="account_financial_report_assets_common"
|
|
||||||
name="account_financial_report report_assets"
|
|
||||||
inherit_id="web.report_assets_common"
|
|
||||||
>
|
|
||||||
<xpath expr="." position="inside">
|
|
||||||
<script
|
|
||||||
type="text/javascript"
|
|
||||||
src="/account_financial_report/static/src/js/report.js"
|
|
||||||
/>
|
|
||||||
</xpath>
|
|
||||||
</template>
|
|
||||||
</odoo>
|
|
|
@ -14,7 +14,7 @@ class AgedPartnerBalanceWizard(models.TransientModel):
|
||||||
_inherit = "account_financial_report_abstract_wizard"
|
_inherit = "account_financial_report_abstract_wizard"
|
||||||
|
|
||||||
date_at = fields.Date(required=True, default=fields.Date.context_today)
|
date_at = fields.Date(required=True, default=fields.Date.context_today)
|
||||||
date_from = fields.Date(string="Date From")
|
date_from = fields.Date()
|
||||||
target_move = fields.Selection(
|
target_move = fields.Selection(
|
||||||
[("posted", "All Posted Entries"), ("all", "All Entries")],
|
[("posted", "All Posted Entries"), ("all", "All Entries")],
|
||||||
string="Target Moves",
|
string="Target Moves",
|
||||||
|
@ -34,12 +34,10 @@ class AgedPartnerBalanceWizard(models.TransientModel):
|
||||||
|
|
||||||
account_code_from = fields.Many2one(
|
account_code_from = fields.Many2one(
|
||||||
comodel_name="account.account",
|
comodel_name="account.account",
|
||||||
string="Account Code From",
|
|
||||||
help="Starting account in a range",
|
help="Starting account in a range",
|
||||||
)
|
)
|
||||||
account_code_to = fields.Many2one(
|
account_code_to = fields.Many2one(
|
||||||
comodel_name="account.account",
|
comodel_name="account.account",
|
||||||
string="Account Code To",
|
|
||||||
help="Ending account in a range",
|
help="Ending account in a range",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -43,9 +43,7 @@ class GeneralLedgerReportWizard(models.TransientModel):
|
||||||
"If partners are filtered, "
|
"If partners are filtered, "
|
||||||
"debits and credits totals will not match the trial balance.",
|
"debits and credits totals will not match the trial balance.",
|
||||||
)
|
)
|
||||||
show_analytic_tags = fields.Boolean(
|
show_analytic_tags = fields.Boolean()
|
||||||
string="Show analytic tags",
|
|
||||||
)
|
|
||||||
receivable_accounts_only = fields.Boolean()
|
receivable_accounts_only = fields.Boolean()
|
||||||
payable_accounts_only = fields.Boolean()
|
payable_accounts_only = fields.Boolean()
|
||||||
partner_ids = fields.Many2many(
|
partner_ids = fields.Many2many(
|
||||||
|
@ -63,9 +61,7 @@ class GeneralLedgerReportWizard(models.TransientModel):
|
||||||
comodel_name="account.analytic.account", string="Filter cost centers"
|
comodel_name="account.analytic.account", string="Filter cost centers"
|
||||||
)
|
)
|
||||||
|
|
||||||
not_only_one_unaffected_earnings_account = fields.Boolean(
|
not_only_one_unaffected_earnings_account = fields.Boolean(readonly=True)
|
||||||
readonly=True, string="Not only one unaffected earnings account"
|
|
||||||
)
|
|
||||||
foreign_currency = fields.Boolean(
|
foreign_currency = fields.Boolean(
|
||||||
string="Show foreign currency",
|
string="Show foreign currency",
|
||||||
help="Display foreign currency for move lines, unless "
|
help="Display foreign currency for move lines, unless "
|
||||||
|
@ -75,16 +71,13 @@ class GeneralLedgerReportWizard(models.TransientModel):
|
||||||
)
|
)
|
||||||
account_code_from = fields.Many2one(
|
account_code_from = fields.Many2one(
|
||||||
comodel_name="account.account",
|
comodel_name="account.account",
|
||||||
string="Account Code From",
|
|
||||||
help="Starting account in a range",
|
help="Starting account in a range",
|
||||||
)
|
)
|
||||||
account_code_to = fields.Many2one(
|
account_code_to = fields.Many2one(
|
||||||
comodel_name="account.account",
|
comodel_name="account.account",
|
||||||
string="Account Code To",
|
|
||||||
help="Ending account in a range",
|
help="Ending account in a range",
|
||||||
)
|
)
|
||||||
show_partner_details = fields.Boolean(
|
show_partner_details = fields.Boolean(
|
||||||
string="Show Partner Details",
|
|
||||||
default=True,
|
default=True,
|
||||||
)
|
)
|
||||||
show_cost_center = fields.Boolean(
|
show_cost_center = fields.Boolean(
|
||||||
|
|
|
@ -14,7 +14,7 @@ class OpenItemsReportWizard(models.TransientModel):
|
||||||
_inherit = "account_financial_report_abstract_wizard"
|
_inherit = "account_financial_report_abstract_wizard"
|
||||||
|
|
||||||
date_at = fields.Date(required=True, default=fields.Date.context_today)
|
date_at = fields.Date(required=True, default=fields.Date.context_today)
|
||||||
date_from = fields.Date(string="Date From")
|
date_from = fields.Date()
|
||||||
target_move = fields.Selection(
|
target_move = fields.Selection(
|
||||||
[("posted", "All Posted Entries"), ("all", "All Entries")],
|
[("posted", "All Posted Entries"), ("all", "All Entries")],
|
||||||
string="Target Moves",
|
string="Target Moves",
|
||||||
|
@ -50,17 +50,13 @@ class OpenItemsReportWizard(models.TransientModel):
|
||||||
default=lambda self: self._default_foreign_currency(),
|
default=lambda self: self._default_foreign_currency(),
|
||||||
)
|
)
|
||||||
show_partner_details = fields.Boolean(
|
show_partner_details = fields.Boolean(
|
||||||
string="Show Partner Details",
|
|
||||||
default=True,
|
default=True,
|
||||||
)
|
)
|
||||||
account_code_from = fields.Many2one(
|
account_code_from = fields.Many2one(
|
||||||
comodel_name="account.account",
|
comodel_name="account.account",
|
||||||
string="Account Code From",
|
|
||||||
help="Starting account in a range",
|
|
||||||
)
|
)
|
||||||
account_code_to = fields.Many2one(
|
account_code_to = fields.Many2one(
|
||||||
comodel_name="account.account",
|
comodel_name="account.account",
|
||||||
string="Account Code To",
|
|
||||||
help="Ending account in a range",
|
help="Ending account in a range",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,6 @@ class TrialBalanceReportWizard(models.TransientModel):
|
||||||
("relation", "Child Accounts"),
|
("relation", "Child Accounts"),
|
||||||
("none", "No hierarchy"),
|
("none", "No hierarchy"),
|
||||||
],
|
],
|
||||||
string="Hierarchy On",
|
|
||||||
required=True,
|
required=True,
|
||||||
default="none",
|
default="none",
|
||||||
help="""Computed Accounts: Use when the account group have codes
|
help="""Computed Accounts: Use when the account group have codes
|
||||||
|
@ -62,9 +61,7 @@ class TrialBalanceReportWizard(models.TransientModel):
|
||||||
partner_ids = fields.Many2many(comodel_name="res.partner", string="Filter partners")
|
partner_ids = fields.Many2many(comodel_name="res.partner", string="Filter partners")
|
||||||
journal_ids = fields.Many2many(comodel_name="account.journal")
|
journal_ids = fields.Many2many(comodel_name="account.journal")
|
||||||
|
|
||||||
not_only_one_unaffected_earnings_account = fields.Boolean(
|
not_only_one_unaffected_earnings_account = fields.Boolean(readonly=True)
|
||||||
readonly=True, string="Not only one unaffected earnings account"
|
|
||||||
)
|
|
||||||
|
|
||||||
foreign_currency = fields.Boolean(
|
foreign_currency = fields.Boolean(
|
||||||
string="Show foreign currency",
|
string="Show foreign currency",
|
||||||
|
@ -74,12 +71,10 @@ class TrialBalanceReportWizard(models.TransientModel):
|
||||||
)
|
)
|
||||||
account_code_from = fields.Many2one(
|
account_code_from = fields.Many2one(
|
||||||
comodel_name="account.account",
|
comodel_name="account.account",
|
||||||
string="Account Code From",
|
|
||||||
help="Starting account in a range",
|
help="Starting account in a range",
|
||||||
)
|
)
|
||||||
account_code_to = fields.Many2one(
|
account_code_to = fields.Many2one(
|
||||||
comodel_name="account.account",
|
comodel_name="account.account",
|
||||||
string="Account Code To",
|
|
||||||
help="Ending account in a range",
|
help="Ending account in a range",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,6 @@ class VATReportWizard(models.TransientModel):
|
||||||
date_to = fields.Date("End Date", required=True)
|
date_to = fields.Date("End Date", required=True)
|
||||||
based_on = fields.Selection(
|
based_on = fields.Selection(
|
||||||
[("taxtags", "Tax Tags"), ("taxgroups", "Tax Groups")],
|
[("taxtags", "Tax Tags"), ("taxgroups", "Tax Groups")],
|
||||||
string="Based On",
|
|
||||||
required=True,
|
required=True,
|
||||||
default="taxtags",
|
default="taxtags",
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue