Update links in report, add account group file, update trial balance with hierarchy.

Update indentation, remove empty lines from header.

Update test.

Update pylint.

Remove company_id on computing accounts, since account.group is not a company based model, filtering accounts is done on trial balance report.

Update account variables.

Improve condition in padding on accounts.

Add option to print hierarchy based on defined accounts/computed accounts.

Add VAT report, hierarchy from tax tags ans taxes.

Fix pylint, xlsx report generation header.

Update code to select code_prefix or name.

Update code to select code_prefix or name.

Update code to select code_prefix or name.

Fix domain in base amounts in vat report.

Change trial balance code_prefix or name.

Update trail balance, add tests for vat report.

Update pylint, amounts as monetary, many2one option on generation excels.

Update pulint.

Add VAT Report in readme.

Add VAT Report in readme.

Update array_agg.

Update array_agg.

Update array_agg.

Add option in VAT Report to be printed on Tax Tags - Tax Groups.

Add widget to hierarchy_on on trial balance.
This commit is contained in:
Fekete Mihai
2018-03-03 17:44:53 +02:00
committed by chaule97
parent feedc2aad2
commit 2547753dcc
44 changed files with 2739 additions and 347 deletions

View File

@@ -1,4 +1,3 @@
# ?? 2015 Yannick Vaucher (Camptocamp)
# ?? 2016 Damien Crier (Camptocamp)
# ?? 2016 Julien Coux (Camptocamp)
@@ -13,3 +12,5 @@ from . import open_items
from . import open_items_xlsx
from . import trial_balance
from . import trial_balance_xlsx
from . import vat_report
from . import vat_report_xlsx

View File

@@ -166,7 +166,10 @@ class AbstractReportXslx(models.AbstractModel):
for col_pos, column in self.columns.items():
value = getattr(line_object, column['field'])
cell_type = column.get('type', 'string')
if cell_type == 'string':
if cell_type == 'many2one':
self.sheet.write_string(
self.row_pos, col_pos, value.name or '')
elif cell_type == 'string':
self.sheet.write_string(self.row_pos, col_pos, value or '')
elif cell_type == 'amount':
self.sheet.write_number(

View File

@@ -201,7 +201,7 @@ class AgedPartnerBalanceReportCompute(models.TransientModel):
rcontext['o'] = report
result['html'] = self.env.ref(
'account_financial_report.report_aged_partner_balance').render(
rcontext)
rcontext)
return result
@api.model
@@ -450,6 +450,7 @@ INSERT INTO
report_partner_id,
create_uid,
create_date,
move_line_id,
date,
date_due,
entry,
@@ -469,6 +470,7 @@ SELECT
rp.id AS report_partner_id,
%s AS create_uid,
NOW() AS create_date,
rlo.move_line_id,
rlo.date,
rlo.date_due,
rlo.entry,

View File

@@ -59,71 +59,70 @@ class AgedPartnerBalanceXslx(models.AbstractModel):
'type': 'amount',
'width': 14},
}
else:
return {
0: {'header': _('Date'), 'field': 'date', 'width': 11},
1: {'header': _('Entry'), 'field': 'entry', 'width': 18},
2: {'header': _('Journal'), 'field': 'journal', 'width': 8},
3: {'header': _('Account'), 'field': 'account', 'width': 9},
4: {'header': _('Partner'), 'field': 'partner', 'width': 25},
5: {'header': _('Ref - Label'), 'field': 'label', 'width': 40},
6: {'header': _('Due date'), 'field': 'date_due', 'width': 11},
7: {'header': _('Residual'),
'field': 'amount_residual',
'field_footer_total': 'cumul_amount_residual',
'field_final_balance': 'amount_residual',
'type': 'amount',
'width': 14},
8: {'header': _('Current'),
'field': 'current',
'field_footer_total': 'cumul_current',
'field_footer_percent': 'percent_current',
'field_final_balance': 'current',
'type': 'amount',
'width': 14},
9: {'header': _(u'Age ??? 30 d.'),
'field': 'age_30_days',
'field_footer_total': 'cumul_age_30_days',
'field_footer_percent': 'percent_age_30_days',
'field_final_balance': 'age_30_days',
'type': 'amount',
'width': 14},
10: {'header': _(u'Age ??? 60 d.'),
'field': 'age_60_days',
'field_footer_total': 'cumul_age_60_days',
'field_footer_percent': 'percent_age_60_days',
'field_final_balance': 'age_60_days',
'type': 'amount',
'width': 14},
11: {'header': _(u'Age ??? 90 d.'),
'field': 'age_90_days',
'field_footer_total': 'cumul_age_90_days',
'field_footer_percent': 'percent_age_90_days',
'field_final_balance': 'age_90_days',
'type': 'amount',
'width': 14},
12: {'header': _(u'Age ??? 120 d.'),
'field': 'age_120_days',
'field_footer_total': 'cumul_age_120_days',
'field_footer_percent': 'percent_age_120_days',
'field_final_balance': 'age_120_days',
'type': 'amount',
'width': 14},
13: {'header': _('Older'),
'field': 'older',
'field_footer_total': 'cumul_older',
'field_footer_percent': 'percent_older',
'field_final_balance': 'older',
'type': 'amount',
'width': 14},
}
return {
0: {'header': _('Date'), 'field': 'date', 'width': 11},
1: {'header': _('Entry'), 'field': 'entry', 'width': 18},
2: {'header': _('Journal'), 'field': 'journal', 'width': 8},
3: {'header': _('Account'), 'field': 'account', 'width': 9},
4: {'header': _('Partner'), 'field': 'partner', 'width': 25},
5: {'header': _('Ref - Label'), 'field': 'label', 'width': 40},
6: {'header': _('Due date'), 'field': 'date_due', 'width': 11},
7: {'header': _('Residual'),
'field': 'amount_residual',
'field_footer_total': 'cumul_amount_residual',
'field_final_balance': 'amount_residual',
'type': 'amount',
'width': 14},
8: {'header': _('Current'),
'field': 'current',
'field_footer_total': 'cumul_current',
'field_footer_percent': 'percent_current',
'field_final_balance': 'current',
'type': 'amount',
'width': 14},
9: {'header': _(u'Age ??? 30 d.'),
'field': 'age_30_days',
'field_footer_total': 'cumul_age_30_days',
'field_footer_percent': 'percent_age_30_days',
'field_final_balance': 'age_30_days',
'type': 'amount',
'width': 14},
10: {'header': _(u'Age ??? 60 d.'),
'field': 'age_60_days',
'field_footer_total': 'cumul_age_60_days',
'field_footer_percent': 'percent_age_60_days',
'field_final_balance': 'age_60_days',
'type': 'amount',
'width': 14},
11: {'header': _(u'Age ??? 90 d.'),
'field': 'age_90_days',
'field_footer_total': 'cumul_age_90_days',
'field_footer_percent': 'percent_age_90_days',
'field_final_balance': 'age_90_days',
'type': 'amount',
'width': 14},
12: {'header': _(u'Age ??? 120 d.'),
'field': 'age_120_days',
'field_footer_total': 'cumul_age_120_days',
'field_footer_percent': 'percent_age_120_days',
'field_final_balance': 'age_120_days',
'type': 'amount',
'width': 14},
13: {'header': _('Older'),
'field': 'older',
'field_footer_total': 'cumul_older',
'field_footer_percent': 'percent_older',
'field_final_balance': 'older',
'type': 'amount',
'width': 14},
}
def _get_report_filters(self, report):
return [
[_('Date at filter'), report.date_at],
[_('Target moves filter'),
_('All posted entries') if report.only_posted_moves
else _('All entries')],
_('All posted entries') if report.only_posted_moves else _(
'All entries')],
]
def _get_col_count_filter_name(self):

View File

@@ -184,7 +184,7 @@ class GeneralLedgerReportMoveLine(models.TransientModel):
debit = fields.Float(digits=(16, 2))
credit = fields.Float(digits=(16, 2))
cumul_balance = fields.Float(digits=(16, 2))
currency_name = fields.Char()
currency_id = fields.Many2one('res.currency')
amount_currency = fields.Float(digits=(16, 2))
@@ -216,7 +216,7 @@ class GeneralLedgerReportCompute(models.TransientModel):
rcontext['o'] = report
result['html'] = self.env.ref(
'account_financial_report.report_general_ledger').render(
rcontext)
rcontext)
return result
@api.model
@@ -226,8 +226,7 @@ class GeneralLedgerReportCompute(models.TransientModel):
@api.multi
def compute_data_for_report(self,
with_line_details=True,
with_partners=True
):
with_partners=True):
self.ensure_one()
# Compute report data
self._inject_account_values()
@@ -884,7 +883,7 @@ INSERT INTO
debit,
credit,
cumul_balance,
currency_name,
currency_id,
amount_currency
)
SELECT
@@ -952,7 +951,7 @@ SELECT
) AS cumul_balance,
"""
query_inject_move_line += """
c.name AS currency_name,
c.id AS currency_id,
ml.amount_currency
FROM
"""
@@ -1213,7 +1212,7 @@ SET
ON l.report_account_id = a.id
WHERE
a.report_id = %s
AND l.currency_name IS NOT NULL
AND l.currency_id IS NOT NULL
LIMIT 1
)
OR
@@ -1230,7 +1229,7 @@ SET
ON p.report_account_id = a.id
WHERE
a.report_id = %s
AND l.currency_name IS NOT NULL
AND l.currency_id IS NOT NULL
LIMIT 1
)
WHERE id = %s

View File

@@ -44,7 +44,8 @@ class GeneralLedgerXslx(models.AbstractModel):
'field_final_balance': 'final_balance',
'type': 'amount',
'width': 14},
11: {'header': _('Cur.'), 'field': 'currency_name', 'width': 7},
11: {'header': _('Cur.'), 'field': 'currency_id',
'type': 'many2one', 'width': 7},
12: {'header': _('Amount cur.'),
'field': 'amount_currency',
'type': 'amount',
@@ -54,14 +55,14 @@ class GeneralLedgerXslx(models.AbstractModel):
def _get_report_filters(self, report):
return [
[_('Date range filter'),
_('From: %s To: %s') % (report.date_from, report.date_to)],
_('From: %s To: %s') % (report.date_from, report.date_to)],
[_('Target moves filter'),
_('All posted entries') if report.only_posted_moves
else _('All entries')],
_('All posted entries') if report.only_posted_moves else _(
'All entries')],
[_('Account balance at 0 filter'),
_('Hide') if report.hide_account_balance_at_0 else _('Show')],
_('Hide') if report.hide_account_balance_at_0 else _('Show')],
[_('Centralize filter'),
_('Yes') if report.centralize else _('No')],
_('Yes') if report.centralize else _('No')],
]
def _get_col_count_filter_name(self):

View File

@@ -128,7 +128,7 @@ class OpenItemsReportMoveLine(models.TransientModel):
label = fields.Char()
amount_total_due = fields.Float(digits=(16, 2))
amount_residual = fields.Float(digits=(16, 2))
currency_name = fields.Char()
currency_id = fields.Many2one('res.currency')
amount_total_due_currency = fields.Float(digits=(16, 2))
amount_residual_currency = fields.Float(digits=(16, 2))
@@ -161,7 +161,7 @@ class OpenItemsReportCompute(models.TransientModel):
rcontext['o'] = report
result['html'] = self.env.ref(
'account_financial_report.report_open_items').render(
rcontext)
rcontext)
return result
@api.model
@@ -512,7 +512,7 @@ INSERT INTO
label,
amount_total_due,
amount_residual,
currency_name,
currency_id,
amount_total_due_currency,
amount_residual_currency
)
@@ -545,7 +545,7 @@ SELECT
CONCAT_WS(' - ', NULLIF(ml.ref, ''), NULLIF(ml.name, '')) AS label,
ml.balance,
ml2.amount_residual,
c.name AS currency_name,
c.id AS currency_id,
ml.amount_currency,
ml2.amount_residual_currency
FROM
@@ -767,7 +767,7 @@ SET
ON p.report_account_id = a.id
WHERE
a.report_id = %s
AND l.currency_name IS NOT NULL
AND l.currency_id IS NOT NULL
LIMIT 1
)
WHERE id = %s

View File

@@ -1,4 +1,3 @@
# Author: Julien Coux
# Copyright 2016 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
@@ -31,7 +30,8 @@ class OpenItemsXslx(models.AbstractModel):
'field_final_balance': 'final_amount_residual',
'type': 'amount',
'width': 14},
9: {'header': _('Cur.'), 'field': 'currency_name', 'width': 7},
9: {'header': _('Cur.'), 'field': 'currency_id',
'type': 'many2one', 'width': 7},
10: {'header': _('Cur. Original'),
'field': 'amount_total_due_currency',
'type': 'amount',
@@ -46,10 +46,10 @@ class OpenItemsXslx(models.AbstractModel):
return [
[_('Date at filter'), report.date_at],
[_('Target moves filter'),
_('All posted entries') if report.only_posted_moves
else _('All entries')],
_('All posted entries') if report.only_posted_moves else _(
'All entries')],
[_('Account balance at 0 filter'),
_('Hide') if report.hide_account_balance_at_0 else _('Show')],
_('Hide') if report.hide_account_balance_at_0 else _('Show')],
]
def _get_col_count_filter_name(self):

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="account_financial_report.report_aged_partner_balance_qweb">
<template id="report_aged_partner_balance_qweb">
<t t-call="web.html_container">
<t t-foreach="docs" t-as="o">
<t t-call="account_financial_report.internal_layout">
@@ -11,7 +11,7 @@
</t>
</template>
<template id="account_financial_report.report_aged_partner_balance_base">
<template id="report_aged_partner_balance_base">
<!-- Saved flag fields into variables, used to define columns display -->
<t t-set="show_move_line_details" t-value="o.show_move_line_details"/>
@@ -81,7 +81,7 @@
</div>
</template>
<template id="account_financial_report.report_aged_partner_balance_filters">
<template id="report_aged_partner_balance_filters">
<div class="act_as_table data_table" style="width: 100%;">
<div class="act_as_row labels">
<div class="act_as_cell">Date at filter</div>
@@ -99,7 +99,7 @@
</div>
</template>
<template id="account_financial_report.report_aged_partner_balance_lines_header">
<template id="report_aged_partner_balance_lines_header">
<!-- Display table headers for lines -->
<div class="act_as_thead">
<div class="act_as_row labels">
@@ -123,7 +123,7 @@
</div>
</template>
<template id="account_financial_report.report_aged_partner_balance_lines">
<template id="report_aged_partner_balance_lines">
<!-- Display each lines -->
<t t-foreach="partner.line_ids" t-as="line">
<!-- # lines -->
@@ -134,78 +134,78 @@
</div>
<!--## amount_residual-->
<div class="act_as_cell amount">
<span t-field="line.amount_residual"/>
<span t-field="line.amount_residual" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</div>
<!--## current-->
<div class="act_as_cell amount">
<span t-field="line.current"/>
<span t-field="line.current" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</div>
<!--## age_30_days-->
<div class="act_as_cell amount">
<span t-field="line.age_30_days"/>
<span t-field="line.age_30_days" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</div>
<!--## age_60_days-->
<div class="act_as_cell amount">
<span t-field="line.age_60_days"/>
<span t-field="line.age_60_days" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</div>
<!--## age_90_days-->
<div class="act_as_cell amount">
<span t-field="line.age_90_days"/>
<span t-field="line.age_90_days" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</div>
<!--## age_120_days-->
<div class="act_as_cell amount">
<span t-field="line.age_120_days"/>
<span t-field="line.age_120_days" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</div>
<!--## older-->
<div class="act_as_cell amount">
<span t-field="line.older"/>
<span t-field="line.older" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</div>
</div>
</t>
</template>
<template id="account_financial_report.report_aged_partner_balance_move_lines">
<template id="report_aged_partner_balance_move_lines">
<div class="act_as_table data_table" style="width: 100%;">
<!-- Display table headers for move lines -->
<div class="act_as_thead">
<div class="act_as_row labels">
<!--## date-->
<div class="act_as_cell first_column" style="width: 5.26%;">
<div class="act_as_cell first_column" style="width: 6.00%;">
Date</div>
<!--## move-->
<div class="act_as_cell" style="width: 8.77%;">Entry</div>
<div class="act_as_cell" style="width: 7.00%;">Entry</div>
<!--## journal-->
<div class="act_as_cell" style="width: 5.01%;">Journal</div>
<div class="act_as_cell" style="width: 5.00%;">Journal</div>
<!--## account code-->
<div class="act_as_cell" style="width: 6.88%;">Account</div>
<div class="act_as_cell" style="width: 6.00%;">Account</div>
<!--## partner-->
<div class="act_as_cell" style="width: 10.52%;">Partner
<div class="act_as_cell" style="width: 10.50%;">Partner
</div>
<!--## ref - label-->
<div class="act_as_cell" style="width: 19.23%;">Ref -
<div class="act_as_cell" style="width: 18.00%;">Ref -
Label</div>
<!--## date_due-->
<div class="act_as_cell" style="width: 6.26%;">Due
<div class="act_as_cell" style="width: 6.00%;">Due
date</div>
<!--## amount_residual-->
<div class="act_as_cell" style="width: 6.19%;">Residual
<div class="act_as_cell" style="width: 6.00%;">Residual
</div>
<!--## current-->
<div class="act_as_cell" style="width: 6.19%;">Current</div>
<div class="act_as_cell" style="width: 6.00%;">Current</div>
<!--## age_30_days-->
<div class="act_as_cell" style="width: 6.19%;">Age ??? 30
<div class="act_as_cell" style="width: 6.00%;">Age ??? 30
d.</div>
<!--## age_60_days-->
<div class="act_as_cell" style="width: 6.19%;">Age ??? 60
<div class="act_as_cell" style="width: 6.00%;">Age ??? 60
d.</div>
<!--## age_90_days-->
<div class="act_as_cell" style="width: 6.19%;">Age ??? 90
<div class="act_as_cell" style="width: 6.00%;">Age ??? 90
d.</div>
<!--## age_120_days-->
<div class="act_as_cell" style="width: 6.19%;">Age ??? 120
<div class="act_as_cell" style="width: 6.00%;">Age ??? 120
d.</div>
<!--## older-->
<div class="act_as_cell" style="width: 6.19%;">Older</div>
<div class="act_as_cell" style="width: 6.00%;">Older</div>
</div>
</div>
<!-- Display each move lines -->
@@ -214,174 +214,288 @@
<div class="act_as_row lines">
<!--## date-->
<div class="act_as_cell left">
<span t-field="line.date"/>
<span>
<a t-att-data-active-id="line.move_line_id.id"
t-att-data-res-model="'account.move.line'"
class="o_account_financial_reports_web_action"
style="color: black;">
<t t-raw="line.date"/></a>
</span>
</div>
<!--## move-->
<div class="act_as_cell left">
<span t-field="line.entry"/>
<span>
<a t-att-data-active-id="line.move_line_id.move_id.id"
t-att-data-res-model="'account.move'"
class="o_account_financial_reports_web_action"
style="color: black;">
<t t-raw="line.entry"/></a>
</span>
</div>
<!--## journal-->
<div class="act_as_cell left">
<span t-field="line.journal"/>
<span>
<a t-att-data-active-id="line.move_line_id.move_id.journal_id.id"
t-att-data-res-model="'account.journal'"
class="o_account_financial_reports_web_action"
style="color: black;">
<t t-raw="line.journal"/></a>
</span>
</div>
<!--## account code-->
<div class="act_as_cell left">
<span t-field="line.account"/>
<span>
<a t-att-data-active-id="line.move_line_id.account_id.id"
t-att-data-res-model="'account.account'"
class="o_account_financial_reports_web_action"
style="color: black;">
<t t-raw="line.account"/></a>
</span>
</div>
<!--## partner-->
<div class="act_as_cell left">
<span t-field="line.partner"/>
<span>
<a t-att-data-active-id="line.move_line_id.partner_id.id"
t-att-data-res-model="'res.partner'"
class="o_account_financial_reports_web_action"
style="color: black;">
<t t-raw="line.partner"/></a>
</span>
</div>
<!--## ref - label-->
<div class="act_as_cell left">
<span t-field="line.label"/>
<span>
<a t-att-data-active-id="line.move_line_id.id"
t-att-data-res-model="'account.move.line'"
class="o_account_financial_reports_web_action"
style="color: black;">
<t t-raw="line.label"/></a>
</span>
</div>
<!--## date_due-->
<div class="act_as_cell left">
<span t-field="line.date_due"/>
<span>
<a t-att-data-active-id="line.move_line_id.id"
t-att-data-res-model="'account.move.line'"
class="o_account_financial_reports_web_action"
style="color: black;">
<t t-raw="line.date_due"/></a>
</span>
</div>
<!--## amount_residual-->
<div class="act_as_cell amount">
<span t-field="line.amount_residual"/>
<span>
<a t-att-data-domain="[('id', 'in', list(filter(lambda x: x != 'False', [str(line.move_line_id.id), str(line.move_line_id.matched_debit_ids.debit_move_id.id), str(line.move_line_id.matched_credit_ids.credit_move_id.id)])))]"
t-att-data-res-model="'account.move.line'"
class="o_account_financial_reports_web_action_multi"
style="color: black;">
<t t-raw="line.amount_residual" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></a>
</span>
</div>
<!--## current-->
<div class="act_as_cell amount">
<span t-field="line.current"/>
<t t-if="line.current != 0">
<span>
<a t-att-data-domain="[('id', 'in', list(filter(lambda x: x != 'False', [str(line.move_line_id.id), str(line.move_line_id.matched_debit_ids.debit_move_id.id), str(line.move_line_id.matched_credit_ids.credit_move_id.id)])))]"
t-att-data-res-model="'account.move.line'"
class="o_account_financial_reports_web_action_multi"
style="color: black;">
<t t-raw="line.current" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></a>
</span>
</t>
<t t-if="line.current == 0">
<span t-field="line.current" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</t>
</div>
<!--## age_30_days-->
<div class="act_as_cell amount">
<span t-field="line.age_30_days"/>
<t t-if="line.age_30_days != 0">
<span>
<a t-att-data-domain="[('id', 'in', list(filter(lambda x: x != 'False', [str(line.move_line_id.id), str(line.move_line_id.matched_debit_ids.debit_move_id.id), str(line.move_line_id.matched_credit_ids.credit_move_id.id)])))]"
t-att-data-res-model="'account.move.line'"
class="o_account_financial_reports_web_action_multi"
style="color: black;">
<t t-raw="line.age_30_days" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></a>
</span>
</t>
<t t-if="line.age_30_days == 0">
<span t-field="line.age_30_days" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</t>
</div>
<!--## age_60_days-->
<div class="act_as_cell amount">
<span t-field="line.age_60_days"/>
<t t-if="line.age_60_days != 0">
<span>
<a t-att-data-domain="[('id', 'in', list(filter(lambda x: x != 'False', [str(line.move_line_id.id), str(line.move_line_id.matched_debit_ids.debit_move_id.id), str(line.move_line_id.matched_credit_ids.credit_move_id.id)])))]"
t-att-data-res-model="'account.move.line'"
class="o_account_financial_reports_web_action_multi"
style="color: black;">
<t t-raw="line.age_60_days" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></a>
</span>
</t>
<t t-if="line.age_60_days == 0">
<span t-field="line.age_60_days" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</t>
</div>
<!--## age_90_days-->
<div class="act_as_cell amount">
<span t-field="line.age_90_days"/>
<t t-if="line.age_90_days != 0">
<span>
<a t-att-data-domain="[('id', 'in', list(filter(lambda x: x != 'False', [str(line.move_line_id.id), str(line.move_line_id.matched_debit_ids.debit_move_id.id), str(line.move_line_id.matched_credit_ids.credit_move_id.id)])))]"
t-att-data-res-model="'account.move.line'"
class="o_account_financial_reports_web_action_multi"
style="color: black;">
<t t-raw="line.age_90_days" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></a>
</span>
</t>
<t t-if="line.age_90_days == 0">
<span t-field="line.age_90_days" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</t>
</div>
<!--## age_120_days-->
<div class="act_as_cell amount">
<span t-field="line.age_120_days"/>
<t t-if="line.age_120_days != 0">
<span>
<a t-att-data-domain="[('id', 'in', list(filter(lambda x: x != 'False', [str(line.move_line_id.id), str(line.move_line_id.matched_debit_ids.debit_move_id.id), str(line.move_line_id.matched_credit_ids.credit_move_id.id)])))]"
t-att-data-res-model="'account.move.line'"
class="o_account_financial_reports_web_action_multi"
style="color: black;">
<t t-raw="line.age_120_days" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></a>
</span>
</t>
<t t-if="line.age_120_days == 0">
<span t-field="line.age_120_days" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</t>
</div>
<!--## older-->
<div class="act_as_cell amount">
<span t-field="line.older"/>
<t t-if="line.older != 0">
<span>
<a t-att-data-domain="[('id', 'in', list(filter(lambda x: x != 'False', [str(line.move_line_id.id), str(line.move_line_id.matched_debit_ids.debit_move_id.id), str(line.move_line_id.matched_credit_ids.credit_move_id.id)])))]"
t-att-data-res-model="'account.move.line'"
class="o_account_financial_reports_web_action_multi"
style="color: black;">
<t t-raw="line.older" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></a>
</span>
</t>
<t t-if="line.older == 0">
<span t-field="line.older" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</t>
</div>
</div>
</t>
</div>
</template>
<template id="account_financial_report.report_aged_partner_balance_partner_ending_cumul">
<template id="report_aged_partner_balance_partner_ending_cumul">
<!-- Display ending balance line for partner -->
<div class="act_as_table list_table" style="width: 100%;">
<div class="act_as_row labels" style="font-weight: bold;">
<div class="act_as_row lines" style="font-weight: bold;">
<!--## date-->
<div class="act_as_cell right" style="width: 51.41%;">Partner
<div class="act_as_cell right" style="width: 52.00%;">Partner
cumul aged balance</div>
<!--## date_due-->
<div class="act_as_cell" style="width: 5.26%;"/>
<div class="act_as_cell" style="width: 6.00%;"/>
<!--## amount_residual-->
<div class="act_as_cell amount" style="width: 6.19%;">
<span t-field="partner_cumul_line.amount_residual"/>
<div class="act_as_cell amount" style="width: 6.00%;">
<span t-field="partner_cumul_line.amount_residual" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</div>
<!--## current-->
<div class="act_as_cell amount" style="width: 6.19%;">
<span t-field="partner_cumul_line.current"/>
<div class="act_as_cell amount" style="width: 6.00%;">
<span t-field="partner_cumul_line.current" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</div>
<!--## age_30_days-->
<div class="act_as_cell amount" style="width: 6.19%;">
<span t-field="partner_cumul_line.age_30_days"/>
<div class="act_as_cell amount" style="width: 6.00%;">
<span t-field="partner_cumul_line.age_30_days" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</div>
<!--## age_60_days-->
<div class="act_as_cell amount" style="width: 6.19%;">
<span t-field="partner_cumul_line.age_60_days"/>
<div class="act_as_cell amount" style="width: 6.00%;">
<span t-field="partner_cumul_line.age_60_days" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</div>
<!--## age_90_days-->
<div class="act_as_cell amount" style="width: 6.19%;">
<span t-field="partner_cumul_line.age_90_days"/>
<div class="act_as_cell amount" style="width: 6.00%;">
<span t-field="partner_cumul_line.age_90_days" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</div>
<!--## age_120_days-->
<div class="act_as_cell amount" style="width: 6.19%;">
<span t-field="partner_cumul_line.age_120_days"/>
<div class="act_as_cell amount" style="width: 6.00%;">
<span t-field="partner_cumul_line.age_120_days" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</div>
<!--## older-->
<div class="act_as_cell amount" style="width: 6.19%;">
<span t-field="partner_cumul_line.older"/>
<div class="act_as_cell amount" style="width: 6.00%;">
<span t-field="partner_cumul_line.older" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</div>
</div>
</div>
</template>
<template id="account_financial_report.report_aged_partner_balance_account_ending_cumul">
<template id="report_aged_partner_balance_account_ending_cumul">
<!-- Display ending balance line for account -->
<div class="act_as_table list_table" style="width: 100%;">
<div class="act_as_row labels" style="font-weight: bold;">
<div class="act_as_row lines" style="font-weight: bold;">
<t t-if="not show_move_line_details">
<!--## total-->
<div class="act_as_cell right" style="width: 32.52%;">Total</div>
<!--## amount_residual-->
<div class="act_as_cell amount" style="width: 9.64%;">
<span t-field="account.cumul_amount_residual"/>
<span t-field="account.cumul_amount_residual" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</div>
<!--## current-->
<div class="act_as_cell amount" style="width: 9.64%;">
<span t-field="account.cumul_current"/>
<span t-field="account.cumul_current" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</div>
<!--## age_30_days-->
<div class="act_as_cell amount" style="width: 9.64%;">
<span t-field="account.cumul_age_30_days"/>
<span t-field="account.cumul_age_30_days" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</div>
<!--## age_60_days-->
<div class="act_as_cell amount" style="width: 9.64%;">
<span t-field="account.cumul_age_60_days"/>
<span t-field="account.cumul_age_60_days" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</div>
<!--## age_90_days-->
<div class="act_as_cell amount" style="width: 9.64%;">
<span t-field="account.cumul_age_90_days"/>
<span t-field="account.cumul_age_90_days" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</div>
<!--## age_120_days-->
<div class="act_as_cell amount" style="width: 9.64%;">
<span t-field="account.cumul_age_120_days"/>
<span t-field="account.cumul_age_120_days" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</div>
<!--## older-->
<div class="act_as_cell amount" style="width: 9.64%;">
<span t-field="account.cumul_older"/>
<span t-field="account.cumul_older" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</div>
</t>
<t t-if="show_move_line_details">
<!--## total-->
<div class="act_as_cell right" style="width: 51.41%;">Total</div>
<div class="act_as_cell right" style="width: 52.00%;">Total</div>
<!--## date_due-->
<div class="act_as_cell" style="width: 5.26%;"/>
<div class="act_as_cell" style="width: 6.00%;"/>
<!--## amount_residual-->
<div class="act_as_cell amount" style="width: 6.19%">
<span t-field="account.cumul_amount_residual"/>
<div class="act_as_cell amount" style="width: 6.00%">
<span t-field="account.cumul_amount_residual" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</div>
<!--## current-->
<div class="act_as_cell amount" style="width: 6.19%">
<span t-field="account.cumul_current"/>
<div class="act_as_cell amount" style="width: 6.00%">
<span t-field="account.cumul_current" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</div>
<!--## age_30_days-->
<div class="act_as_cell amount" style="width: 6.19%">
<span t-field="account.cumul_age_30_days"/>
<div class="act_as_cell amount" style="width: 6.00%">
<span t-field="account.cumul_age_30_days" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</div>
<!--## age_60_days-->
<div class="act_as_cell amount" style="width: 6.19%">
<span t-field="account.cumul_age_60_days"/>
<div class="act_as_cell amount" style="width: 6.00%">
<span t-field="account.cumul_age_60_days" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</div>
<!--## age_90_days-->
<div class="act_as_cell amount" style="width: 6.19%">
<span t-field="account.cumul_age_90_days"/>
<div class="act_as_cell amount" style="width: 6.00%">
<span t-field="account.cumul_age_90_days" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</div>
<!--## age_120_days-->
<div class="act_as_cell amount" style="width: 6.19%">
<span t-field="account.cumul_age_120_days"/>
<div class="act_as_cell amount" style="width: 6.00%">
<span t-field="account.cumul_age_120_days" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</div>
<!--## older-->
<div class="act_as_cell amount" style="width: 6.19%">
<span t-field="account.cumul_older"/>
<div class="act_as_cell amount" style="width: 6.00%">
<span t-field="account.cumul_older" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</div>
</t>
</div>
@@ -414,29 +528,29 @@
</t>
<t t-if="show_move_line_details">
<!--## total-->
<div class="act_as_cell right" style="width: 51.41%;">
<div class="act_as_cell right" style="width: 52.00%;">
Percents</div>
<!--## date_due-->
<div class="act_as_cell" style="width: 5.26%;"/>
<div class="act_as_cell" style="width: 6.00%;"/>
<!--## amount_residual-->
<div class="act_as_cell amount" style="width: 6.19%"/>
<div class="act_as_cell amount" style="width: 6.00%"/>
<!--## current-->
<div class="act_as_cell amount" style="width: 6.19%"><span t-field="account.percent_current"/>%
<div class="act_as_cell amount" style="width: 6.00%"><span t-field="account.percent_current"/>%
</div>
<!--## age_30_days-->
<div class="act_as_cell amount" style="width: 6.19%"><span t-field="account.percent_age_30_days"/>%
<div class="act_as_cell amount" style="width: 6.00%"><span t-field="account.percent_age_30_days"/>%
</div>
<!--## age_60_days-->
<div class="act_as_cell amount" style="width: 6.19%"><span t-field="account.percent_age_60_days"/>%
<div class="act_as_cell amount" style="width: 6.00%"><span t-field="account.percent_age_60_days"/>%
</div>
<!--## age_90_days-->
<div class="act_as_cell amount" style="width: 6.19%"><span t-field="account.percent_age_90_days"/>%
<div class="act_as_cell amount" style="width: 6.00%"><span t-field="account.percent_age_90_days"/>%
</div>
<!--## age_120_days-->
<div class="act_as_cell amount" style="width: 6.19%"><span t-field="account.percent_age_120_days"/>%
<div class="act_as_cell amount" style="width: 6.00%"><span t-field="account.percent_age_120_days"/>%
</div>
<!--## older-->
<div class="act_as_cell amount" style="width: 6.19%"><span t-field="account.percent_older"/>%
<div class="act_as_cell amount" style="width: 6.00%"><span t-field="account.percent_older"/>%
</div>
</t>
</div>

View File

@@ -34,6 +34,7 @@
<t t-if="not account.partner_ids">
<!-- Display account move lines without partner regroup -->
<t t-set="type" t-value='"account_type"'/>
<t t-call="account_financial_report.report_general_ledger_lines">
<t t-set="account_or_partner_object" t-value="account"/>
</t>
@@ -42,6 +43,7 @@
<t t-if="account.partner_ids">
<!-- Display account partners -->
<t t-foreach="account.partner_ids" t-as="partner">
<t t-set="type" t-value='"partner_type"'/>
<div class="page_break">
<!-- Display partner header -->
<div class="act_as_caption account_title">
@@ -116,7 +118,7 @@
<!--## account code-->
<div class="act_as_cell" style="width: 5.19%;">Account</div>
<!--## partner-->
<div class="act_as_cell" style="width: 10%;">Partner
<div class="act_as_cell" style="width: 13.11%;">Partner
</div>
<!--## ref - label-->
<div class="act_as_cell" style="width: 25%;">Ref -
@@ -134,8 +136,6 @@
<div class="act_as_cell amount" style="width: 6.57%;">Credit</div>
<!--## balance cumulated-->
<div class="act_as_cell amount" style="width: 6.57%;">Cumul. Bal.</div>
<!--## currency_name-->
<div class="act_as_cell" style="width: 3.11%;">Cur.</div>
<!--## amount_currency-->
<div class="act_as_cell amount" style="width: 6.57%;">Amount cur.</div>
</div>
@@ -162,13 +162,93 @@
<!--## matching_number-->
<div class="act_as_cell"/>
<!--## debit-->
<div class="act_as_cell amount"><span t-field="account_or_partner_object.initial_debit"/></div>
<div class="act_as_cell amount">
<t t-if="type == 'account_type'">
<t t-set="domain"
t-value="[('account_id', '=', account_or_partner_object.account_id.id),
('date', '&lt;', o.date_from),
('debit', '&lt;&gt;', 0)]"/>
<span>
<a t-att-data-domain="domain"
t-att-data-res-model="'account.move.line'"
class="o_account_financial_reports_web_action_multi"
style="color: black;">
<t t-raw="account_or_partner_object.initial_debit" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></a>
</span>
</t>
<t t-if="type == 'partner_type'">
<t t-set="domain"
t-value="[('account_id', '=', account_or_partner_object.report_account_id.account_id.id),
('partner_id', '=', account_or_partner_object.partner_id.id),
('date', '&lt;', o.date_from),
('debit', '&lt;&gt;', 0)]"/>
<span>
<a t-att-data-domain="domain"
t-att-data-res-model="'account.move.line'"
class="o_account_financial_reports_web_action_multi"
style="color: black;">
<t t-raw="account_or_partner_object.initial_debit" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></a>
</span>
</t>
</div>
<!--## credit-->
<div class="act_as_cell amount"><span t-field="account_or_partner_object.initial_credit"/></div>
<div class="act_as_cell amount">
<t t-if="type == 'account_type'">
<t t-set="domain"
t-value="[('account_id', '=', account_or_partner_object.account_id.id),
('date', '&lt;', o.date_from),
('credit', '&lt;&gt;', 0)]"/>
<span>
<a t-att-data-domain="domain"
t-att-data-res-model="'account.move.line'"
class="o_account_financial_reports_web_action_multi"
style="color: black;">
<t t-raw="account_or_partner_object.initial_credit" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></a>
</span>
</t>
<t t-if="type == 'partner_type'">
<t t-set="domain"
t-value="[('account_id', '=', account_or_partner_object.report_account_id.account_id.id),
('partner_id', '=', account_or_partner_object.partner_id.id),
('date', '&lt;', o.date_from),
('credit', '&lt;&gt;', 0)]"/>
<span>
<a t-att-data-domain="domain"
t-att-data-res-model="'account.move.line'"
class="o_account_financial_reports_web_action_multi"
style="color: black;">
<t t-raw="account_or_partner_object.initial_credit" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></a>
</span>
</t>
</div>
<!--## balance cumulated-->
<div class="act_as_cell amount"><span t-field="account_or_partner_object.initial_balance"/></div>
<!--## currency_name-->
<div class="act_as_cell"/>
<div class="act_as_cell amount">
<t t-if="type == 'account_type'">
<t t-set="domain"
t-value="[('account_id', '=', account_or_partner_object.account_id.id),
('date', '&lt;', o.date_from)]"/>
<span>
<a t-att-data-domain="domain"
t-att-data-res-model="'account.move.line'"
class="o_account_financial_reports_web_action_multi"
style="color: black;">
<t t-raw="account_or_partner_object.initial_balance" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></a>
</span>
</t>
<t t-if="type == 'partner_type'">
<t t-set="domain"
t-value="[('account_id', '=', account_or_partner_object.report_account_id.account_id.id),
('partner_id', '=', account_or_partner_object.partner_id.id),
('date', '&lt;', o.date_from)]"/>
<span>
<a t-att-data-domain="domain"
t-att-data-res-model="'account.move.line'"
class="o_account_financial_reports_web_action_multi"
style="color: black;">
<t t-raw="account_or_partner_object.initial_balance" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></a>
</span>
</t>
</div>
<!--## amount_currency-->
<div class="act_as_cell"/>
</div>
@@ -178,7 +258,16 @@
<!-- # lines or centralized lines -->
<div class="act_as_row lines">
<!--## date-->
<div class="act_as_cell left"><span t-field="line.date"/></div>
<div class="act_as_cell left">
<t t-set="res_model" t-value="'account.move.line'"/>
<span>
<a t-att-data-active-id="line.move_line_id.id"
t-att-data-res-model="res_model"
class="o_account_financial_reports_web_action"
style="color: black;">
<t t-raw="line.date"/></a>
</span>
</div>
<!--## move-->
<div class="act_as_cell left">
<t t-set="res_model" t-value="'account.move'"/>
@@ -191,9 +280,27 @@
</span>
</div>
<!--## journal-->
<div class="act_as_cell left"><span t-field="line.journal"/></div>
<div class="act_as_cell left">
<t t-set="res_model" t-value="'account.journal'"/>
<span>
<a t-att-data-active-id="line.move_line_id.move_id.journal_id.id"
t-att-data-res-model="res_model"
class="o_account_financial_reports_web_action"
style="color: black;">
<t t-raw="line.journal"/></a>
</span>
</div>
<!--## account code-->
<div class="act_as_cell left"><span t-field="line.account"/></div>
<div class="act_as_cell left">
<t t-set="res_model" t-value="'account.account'"/>
<span>
<a t-att-data-active-id="line.move_line_id.account_id.id"
t-att-data-res-model="res_model"
class="o_account_financial_reports_web_action"
style="color: black;">
<t t-raw="line.account"/></a>
</span>
</div>
<!--## partner-->
<div class="act_as_cell left">
<t t-set="res_model" t-value="'res.partner'"/>
@@ -205,26 +312,85 @@
</span>
</div>
<!--## ref - label-->
<div class="act_as_cell left"><span t-field="line.label"/></div>
<t t-if="show_cost_center">
<!--## cost_center-->
<div class="act_as_cell left"><span t-field="line.cost_center"/></div>
<div class="act_as_cell left">
<t t-set="res_model" t-value="'account.move.line'"/>
<span>
<a t-att-data-active-id="line.move_line_id.id"
t-att-data-res-model="res_model"
class="o_account_financial_reports_web_action"
style="color: black;">
<t t-raw="line.label"/></a>
</span>
</div>
<!--## cost_center-->
<t t-if="show_cost_center">
<div class="act_as_cell left">
<t t-set="res_model" t-value="'account_analytic_account'"/>
<span t-if="line.cost_center">
<a t-att-data-active-id="line.move_line_id.analytic_account_id.id"
t-att-data-res-model="res_model"
class="o_account_financial_reports_web_action"
style="color: black;"><t t-raw="line.cost_center"/></a>
</span>
</div>
</t>
<!--## matching_number-->
<div class="act_as_cell"><span t-field="line.matching_number"/></div>
<div class="act_as_cell">
<t t-set="res_model" t-value="'account_full_reconcile'"/>
<span t-if="line.matching_number">
<a t-att-data-active-id="line.move_line_id.full_reconcile_id.id"
t-att-data-res-model="res_model"
class="o_account_financial_reports_web_action"
style="color: black;"><t t-raw="line.matching_number"/></a>
</span>
</div>
<!--## debit-->
<div class="act_as_cell amount"><span t-field="line.debit"/></div>
<div class="act_as_cell amount">
<t t-set="res_model" t-value="'account.move.line'"/>
<span>
<a t-att-data-active-id="line.move_line_id.id"
t-att-data-res-model="res_model"
class="o_account_financial_reports_web_action"
style="color: black;">
<t t-raw="line.debit" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></a>
</span>
</div>
<!--## credit-->
<div class="act_as_cell amount"><span t-field="line.credit"/></div>
<div class="act_as_cell amount">
<t t-set="res_model" t-value="'account.move.line'"/>
<span>
<a t-att-data-active-id="line.move_line_id.id"
t-att-data-res-model="res_model"
class="o_account_financial_reports_web_action"
style="color: black;">
<t t-raw="line.credit" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></a>
</span>
</div>
<!--## balance cumulated-->
<div class="act_as_cell amount"><span t-field="line.cumul_balance"/></div>
<!--## currency_name-->
<div class="act_as_cell"><span t-field="line.currency_name"/></div>
<t t-if="line.currency_name">
<div class="act_as_cell amount">
<t t-set="res_model" t-value="'account.move.line'"/>
<span>
<a t-att-data-active-id="line.move_line_id.id"
t-att-data-res-model="res_model"
class="o_account_financial_reports_web_action"
style="color: black;">
<t t-raw="line.cumul_balance" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></a>
</span>
</div>
<t t-if="line.currency_id">
<!--## amount_currency-->
<div class="act_as_cell amount"><span t-field="line.amount_currency"/></div>
<div class="act_as_cell amount">
<t t-set="res_model" t-value="'account.move.line'"/>
<span>
<a t-att-data-active-id="line.move_line_id.id"
t-att-data-res-model="res_model"
class="o_account_financial_reports_web_action"
style="color: black;">
<t t-raw="line.amount_currency" t-options="{'widget': 'monetary', 'display_currency': line.currency_id}"/></a>
</span>
</div>
</t>
<t t-if="not line.currency_name">
<t t-if="not line.currency_id">
<!--## amount_currency-->
<div class="act_as_cell"/>
</t>
@@ -240,32 +406,35 @@
<!--## date-->
<t t-if='type == "account_type"'>
<div class="act_as_cell first_column"
style="width: 33.33%;"><span
style="width: 33.81%;"><span
t-field="account_or_partner_object.code"/> - <span t-field="account_or_partner_object.name"/></div>
<div class="act_as_cell right"
style="width: 25.44%;">Ending balance</div>
style="width: 28.51%;">Ending balance</div>
</t>
<t t-if='type == "partner_type"'>
<div class="act_as_cell first_column" style="width: 33.33%;"/>
<div class="act_as_cell right" style="width: 25.44%;">Partner ending balance</div>
<div class="act_as_cell first_column" style="width: 33.81%;"/>
<div class="act_as_cell right" style="width: 28.51%;">Partner ending balance</div>
</t>
<t t-if="show_cost_center">
<!--## cost_center-->
<div class="act_as_cell" style="width: 8.77%"/>
</t>
<!--## matching_number-->
<div class="act_as_cell" style="width: 3.11%;"/>
<div class="act_as_cell" style="width: 2.63%;"/>
<!--## debit-->
<div class="act_as_cell amount" style="width: 6.57%;"><span
t-field="account_or_partner_object.final_debit"/></div>
<div class="act_as_cell amount" style="width: 6.57%;">
<span t-field="account_or_partner_object.final_debit" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</div>
<!--## credit-->
<div class="act_as_cell amount" style="width: 6.57%;"><span
t-field="account_or_partner_object.final_credit"/></div>
<div class="act_as_cell amount" style="width: 6.57%;">
<span t-field="account_or_partner_object.final_credit" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</div>
<!--## balance cumulated-->
<div class="act_as_cell amount" style="width: 6.57%;"><span
t-field="account_or_partner_object.final_balance"/></div>
<div class="act_as_cell amount" style="width: 6.57%;">
<span t-field="account_or_partner_object.final_balance" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</div>
<!--## currency_name + amount_currency-->
<div class="act_as_cell" style="width: 9.64%;"/>
<div class="act_as_cell" style="width: 6.57%;"/>
</div>
</div>

View File

@@ -102,7 +102,7 @@
<!--## account code-->
<div class="act_as_cell" style="width: 5.38%;">Account</div>
<!--## partner-->
<div class="act_as_cell" style="width: 12.0%;">Partner
<div class="act_as_cell" style="width: 15.07%;">Partner
</div>
<!--## ref - label-->
<div class="act_as_cell" style="width: 25.5%;">Ref -
@@ -115,8 +115,6 @@
</div>
<!--## amount_residual-->
<div class="act_as_cell" style="width: 6.57%;">Residual</div>
<!--## currency_name-->
<div class="act_as_cell" style="width: 3.07%;">Cur.</div>
<!--## amount_total_due_currency-->
<div class="act_as_cell amount" style="width: 6.57%;">Cur. Original</div>
<!--## amount_residual_currency-->
@@ -174,27 +172,23 @@
</div>
<!--## amount_total_due-->
<div class="act_as_cell amount">
<span t-field="line.amount_total_due"/>
<span t-field="line.amount_total_due" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</div>
<!--## amount_residual-->
<div class="act_as_cell amount">
<span t-field="line.amount_residual"/>
<span t-field="line.amount_residual" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</div>
<!--## currency_name-->
<div class="act_as_cell">
<span t-field="line.currency_name"/>
</div>
<t t-if="line.currency_name">
<t t-if="line.currency_id">
<!--## amount_total_due_currency-->
<div class="act_as_cell amount">
<span t-field="line.amount_total_due_currency"/>
<span t-field="line.amount_total_due_currency" t-options="{'widget': 'monetary', 'display_currency': line.currency_id}"/>
</div>
<!--## amount_residual_currency-->
<div class="act_as_cell amount">
<span t-field="line.amount_residual_currency"/>
<span t-field="line.amount_residual_currency" t-options="{'widget': 'monetary', 'display_currency': line.currency_id}"/>
</div>
</t>
<t t-if="not line.currency_name">
<t t-if="not line.currency_id">
<!--## amount_total_due_currency-->
<div class="act_as_cell"/>
<!--## amount_residual_currency-->
@@ -211,30 +205,30 @@
<div class="act_as_row labels" style="font-weight: bold;">
<!--## date-->
<t t-if='type == "account_type"'>
<div class="act_as_cell first_column" style="width: 34.3%;">
<div class="act_as_cell first_column" style="width: 37.37%;">
<span t-field="account_or_partner_object.code"/>
-
<span t-field="account_or_partner_object.name"/>
</div>
<div class="act_as_cell right" style="width: 26.4%;">Ending
<div class="act_as_cell right" style="width: 29.47%;">Ending
balance</div>
</t>
<t t-if='type == "partner_type"'>
<div class="act_as_cell first_column"
style="width: 34.3%;"/>
style="width: 37.37%;"/>
<div class="act_as_cell right"
style="width: 26.4%;">Partner ending balance</div>
style="width: 29.47%;">Partner ending balance</div>
</t>
<!--## date_due-->
<div class="act_as_cell" style="width: 6.26%;"/>
<!--## amount_total_due-->
<div class="act_as_cell amount" style="width: 7.57%;"/>
<div class="act_as_cell amount" style="width: 6.57%;"/>
<!--## amount_currency-->
<div class="act_as_cell amount" style="width: 7.57%;">
<span t-field="account_or_partner_object.final_amount_residual"/>
<div class="act_as_cell amount" style="width: 6.57%;">
<span t-field="account_or_partner_object.final_amount_residual" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/>
</div>
<!--## currency_name + amount_total_due_currency + amount_residual_currency -->
<div class="act_as_cell" style="width: 17.90%;"/>
<!--## amount_total_due_currency + amount_residual_currency -->
<div class="act_as_cell" style="width: 13.14%;"/>
</div>
</div>
</template>

View File

@@ -27,24 +27,46 @@
<div class="act_as_table data_table" style="width: 100%;">
<!-- Display account header -->
<t t-call="account_financial_report.report_trial_balance_lines_header"/>
<!-- Display each lines -->
<t t-foreach="o.account_ids" t-as="line">
<t t-set="type" t-value='"account_type"'/>
<!-- Adapt -->
<t t-set="style" t-value="'font-size:8px;'"/>
<t t-set="padding" t-value="line.level * 4"/>
<t t-set="style" t-value="'font-size: ' + str(14 - line.level) + 'px; margin-left: ' + str(line.level * 4) + 'px;'"/>
<t t-if="line.account_group_id">
<t t-set="style" t-value="style + 'font-weight: bold; color: blue;'"/>
</t>
<!-- Display account lines -->
<t t-call="account_financial_report.report_trial_balance_line"/>
<!-- Adapt style -->
</t>
</div>
</t>
<!-- Display partner lines -->
<t t-if="show_partner_details">
<t t-set="padding" t-value="0"/>
<t t-foreach="o.account_ids" t-as="account">
<div class="page_break">
<t t-set="style" t-value="'font-size:8px;'"/>
<t t-set="padding" t-value="account.level * 4"/>
<t t-set="style" t-value="'font-size: ' + str(14 - account.level) + 'px; margin-left: ' + str(account.level * 4) + 'px;'"/>
<!-- Display account header -->
<div class="act_as_table list_table" style="margin-top: 10px;"/>
<div class="act_as_caption account_title"
style="width: 100%;">
<span t-field="account.code"/> - <span t-field="account.name"/>
<t t-set="res_model" t-value="'account.account'"/>
<span>
<a t-att-data-active-id="account.account_id.id"
t-att-data-res-model="res_model"
class="o_account_financial_reports_web_action"
t-att-style="style">
<t t-raw="account.code"/> - <t t-raw="account.name"/></a>
</span>
</div>
<div class="act_as_table data_table"
@@ -52,15 +74,22 @@
<!-- Display account/partner header -->
<t t-call="account_financial_report.report_trial_balance_lines_header"/>
<!-- Adapt style -->
<t t-set="padding" t-value="padding+4"/>
<!-- Display each partners -->
<t t-foreach="account.partner_ids" t-as="line">
<t t-set="type" t-value='"partner_type"'/>
<!-- Display partner line -->
<t t-call="account_financial_report.report_trial_balance_line"/>
</t>
<t t-set="padding" t-value="padding-4"/>
</div>
<!-- Display account footer -->
<t t-call="account_financial_report.report_trial_balance_account_footer"/>
<t t-set="type" t-value='"account_type"'/>
<t t-call="account_financial_report.report_trial_balance_account_footer"/>
</div>
</t>
</t>
@@ -124,18 +153,241 @@
<div class="act_as_row lines">
<t t-if="not show_partner_details">
<!--## Code-->
<div class="act_as_cell left"><span t-field="line.code"/></div>
<div class="act_as_cell left">
<t t-if="line.account_id">
<t t-set="res_model" t-value="'account.account'"/>
<span>
<a t-att-data-active-id="line.account_id.id"
t-att-data-res-model="res_model"
class="o_account_financial_reports_web_action"
t-att-style="style">
<t t-att-style="style" t-raw="line.code"/></a>
</span>
</t>
<t t-if="line.account_group_id">
<t t-set="res_model" t-value="'account.group'"/>
<span>
<a t-att-data-active-id="line.account_group_id.id"
t-att-data-res-model="res_model"
class="o_account_financial_reports_web_action"
t-att-style="style">
<t t-att-style="style" t-raw="line.code"/></a>
</span>
</t>
</div>
</t>
<!--## Account/Partner-->
<div class="act_as_cell left"><span t-field="line.name"/></div>
<div class="act_as_cell left">
<t t-if="type == 'account_type'">
<t t-if="line.account_id">
<t t-set="res_model" t-value="'account.account'"/>
<span>
<a t-att-data-active-id="line.account_id.id"
t-att-data-res-model="res_model"
class="o_account_financial_reports_web_action"
t-att-style="style">
<t t-att-style="style" t-raw="line.name"/></a>
</span>
</t>
<t t-if="line.account_group_id">
<t t-set="res_model" t-value="'account.group'"/>
<span>
<a t-att-data-active-id="line.account_group_id.id"
t-att-data-res-model="res_model"
class="o_account_financial_reports_web_action"
t-att-style="style">
<t t-att-style="style" t-raw="line.name"/></a>
</span>
</t>
</t>
<t t-if="type == 'partner_type'">
<t t-set="res_model" t-value="'res.partner'"/>
<span>
<a t-att-data-active-id="line.partner_id.id"
t-att-data-res-model="res_model"
class="o_account_financial_reports_web_action"
t-att-style="style">
<t t-att-style="style" t-raw="line.name"/></a>
</span>
</t>
</div>
<!--## Initial balance-->
<div class="act_as_cell amount"><span t-field="line.initial_balance"/></div>
<div class="act_as_cell amount">
<t t-if="type == 'account_type'">
<t t-if="line.account_id">
<t t-set="domain"
t-value="[('account_id', '=', line.account_id.id),
('date', '&lt;', o.date_from)]"/>
<span>
<a t-att-data-domain="domain"
t-att-data-res-model="'account.move.line'"
class="o_account_financial_reports_web_action_multi"
t-att-style="style">
<t t-att-style="style" t-raw="line.initial_balance" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></a>
</span>
</t>
<t t-if="line.account_group_id">
<t t-set="domain"
t-value="[('account_id', 'in', line.compute_account_ids.ids),
('date', '&lt;', o.date_from)]"/>
<span>
<a t-att-data-domain="domain"
t-att-data-res-model="'account.move.line'"
class="o_account_financial_reports_web_action_multi"
t-att-style="style">
<t t-att-style="style" t-raw="line.initial_balance" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></a>
</span>
</t>
</t>
<t t-if="type == 'partner_type'">
<t t-set="domain"
t-value="[('account_id', '=', line.report_account_id.account_id.id),
('partner_id', '=', line.partner_id.id),
('date', '&lt;', o.date_from)]"/>
<span>
<a t-att-data-domain="domain"
t-att-data-res-model="'account.move.line'"
class="o_account_financial_reports_web_action_multi"
t-att-style="style">
<t t-att-style="style" t-raw="line.initial_balance" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></a>
</span>
</t>
</div>
<!--## Debit-->
<div class="act_as_cell amount"><span t-field="line.debit"/></div>
<div class="act_as_cell amount">
<t t-if="type == 'account_type'">
<t t-if="line.account_id">
<t t-set="domain"
t-value="[('account_id', '=', line.account_id.id),
('date', '&gt;=', line.report_id.date_from),
('date', '&lt;=', line.report_id.date_to),
('debit', '&lt;&gt;', 0)]"/>
<span>
<a t-att-data-domain="domain"
t-att-data-res-model="'account.move.line'"
class="o_account_financial_reports_web_action_multi"
t-att-style="style">
<t t-att-style="style" t-raw="line.debit" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></a>
</span>
</t>
<t t-if="line.account_group_id">
<t t-set="domain"
t-value="[('account_id', 'in', line.compute_account_ids.ids),
('date', '&gt;=', line.report_id.date_from),
('date', '&lt;=', line.report_id.date_to),
('debit', '&lt;&gt;', 0)]"/>
<span>
<a t-att-data-domain="domain"
t-att-data-res-model="'account.move.line'"
class="o_account_financial_reports_web_action_multi"
t-att-style="style">
<t t-att-style="style" t-raw="line.debit" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></a>
</span>
</t>
</t>
<t t-if="type == 'partner_type'">
<t t-set="domain"
t-value="[('account_id', '=', line.report_account_id.account_id.id),
('partner_id', '=', line.partner_id.id),
('date', '&gt;=', line.report_account_id.report_id.date_from),
('date', '&lt;=', line.report_account_id.report_id.date_to),
('debit', '&lt;&gt;', 0)]"/>
<span>
<a t-att-data-domain="domain"
t-att-data-res-model="'account.move.line'"
class="o_account_financial_reports_web_action_multi"
t-att-style="style">
<t t-att-style="style" t-raw="line.debit" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></a>
</span>
</t>
</div>
<!--## Credit-->
<div class="act_as_cell amount"><span t-field="line.credit"/></div>
<div class="act_as_cell amount">
<t t-if="type == 'account_type'">
<t t-if="line.account_id">
<t t-set="domain"
t-value="[('account_id', '=', line.account_id.id),
('date', '&gt;=', line.report_id.date_from),
('date', '&lt;=', line.report_id.date_to),
('credit', '&lt;&gt;', 0)]"/>
<span>
<a t-att-data-domain="domain"
t-att-data-res-model="'account.move.line'"
class="o_account_financial_reports_web_action_multi"
t-att-style="style">
<t t-att-style="style" t-raw="line.credit" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></a>
</span>
</t>
<t t-if="line.account_group_id">
<t t-set="domain"
t-value="[('account_id', 'in', line.compute_account_ids.ids),
('date', '&gt;=', line.report_id.date_from),
('date', '&lt;=', line.report_id.date_to),
('credit', '&lt;&gt;', 0)]"/>
<span>
<a t-att-data-domain="domain"
t-att-data-res-model="'account.move.line'"
class="o_account_financial_reports_web_action_multi"
t-att-style="style">
<t t-att-style="style" t-raw="line.credit" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></a>
</span>
</t>
</t>
<t t-if="type == 'partner_type'">
<t t-set="domain"
t-value="[('account_id', '=', line.report_account_id.account_id.id),
('partner_id', '=', line.partner_id.id),
('date', '&gt;=', line.report_account_id.report_id.date_from),
('date', '&lt;=', line.report_account_id.report_id.date_to),
('credit', '&lt;&gt;', 0)]"/>
<span>
<a t-att-data-domain="domain"
t-att-data-res-model="'account.move.line'"
class="o_account_financial_reports_web_action_multi"
t-att-style="style">
<t t-att-style="style" t-raw="line.credit" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></a>
</span>
</t>
</div>
<!--## Ending balance-->
<div class="act_as_cell amount"><span t-field="line.final_balance"/></div>
<div class="act_as_cell amount">
<t t-if="type == 'account_type'">
<t t-if="line.account_id">
<t t-set="domain"
t-value="[('account_id', '=', line.account_id.id)]"/>
<span>
<a t-att-data-domain="domain"
t-att-data-res-model="'account.move.line'"
class="o_account_financial_reports_web_action_multi"
t-att-style="style">
<t t-att-style="style" t-raw="line.final_balance" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></a>
</span>
</t>
<t t-if="line.account_group_id">
<t t-set="domain"
t-value="[('account_id', 'in', line.compute_account_ids.ids)]"/>
<span>
<a t-att-data-domain="domain"
t-att-data-res-model="'account.move.line'"
class="o_account_financial_reports_web_action_multi"
t-att-style="style">
<t t-att-style="style" t-raw="line.final_balance" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></a>
</span>
</t>
</t>
<t t-if="type == 'partner_type'">
<t t-set="domain"
t-value="[('account_id', '=', line.report_account_id.account_id.id),
('partner_id', '=', line.partner_id.id)]"/>
<span>
<a t-att-data-domain="domain"
t-att-data-res-model="'account.move.line'"
class="o_account_financial_reports_web_action_multi"
t-att-style="style">
<t t-att-style="style" t-raw="line.final_balance" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></a>
</span>
</t>
</div>
</div>
</template>
@@ -144,16 +396,71 @@
<div class="act_as_table list_table" style="width: 100%;">
<div class="act_as_row labels" style="font-weight: bold;">
<!--## Account-->
<div class="act_as_cell left" style="width: 61.44%;"><span
t-field="account.code"/> - <span t-field="account.name"/></div>
<div class="act_as_cell left" style="width: 61.44%;">
<t t-set="res_model" t-value="'account.account'"/>
<span>
<a t-att-data-active-id="account.account_id.id"
t-att-data-res-model="res_model"
class="o_account_financial_reports_web_action"
t-att-style="style">
<t t-att-style="style" t-raw="account.code"/> - <t t-att-style="style" t-raw="account.name"/></a>
</span>
</div>
<!--## Initial balance-->
<div class="act_as_cell amount" style="width: 9.64%;"><span t-field="account.initial_balance"/></div>
<div class="act_as_cell amount" style="width: 9.64%;">
<t t-set="domain"
t-value="[('account_id', '=', account.account_id.id),
('date', '&lt;', o.date_from)]"/>
<span>
<a t-att-data-domain="domain"
t-att-data-res-model="'account.move.line'"
class="o_account_financial_reports_web_action_multi"
t-att-style="style">
<t t-att-style="style" t-raw="account.initial_balance" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></a>
</span>
</div>
<!--## Debit-->
<div class="act_as_cell amount" style="width: 9.64%;"><span t-field="account.debit"/></div>
<div class="act_as_cell amount" style="width: 9.64%;">
<t t-set="domain"
t-value="[('account_id', '=', account.account_id.id),
('date', '&gt;=', account.report_id.date_from),
('date', '&lt;=', account.report_id.date_to),
('debit', '&lt;&gt;', 0)]"/>
<span>
<a t-att-data-domain="domain"
t-att-data-res-model="'account.move.line'"
class="o_account_financial_reports_web_action_multi"
t-att-style="style">
<t t-att-style="style" t-raw="account.debit" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></a>
</span>
</div>
<!--## Credit-->
<div class="act_as_cell amount" style="width: 9.64%;"><span t-field="account.credit"/></div>
<div class="act_as_cell amount" style="width: 9.64%;">
<t t-set="domain"
t-value="[('account_id', '=', account.account_id.id),
('date', '&gt;=', account.report_id.date_from),
('date', '&lt;=', account.report_id.date_to),
('credit', '&lt;&gt;', 0)]"/>
<span>
<a t-att-data-domain="domain"
t-att-data-res-model="'account.move.line'"
class="o_account_financial_reports_web_action_multi"
t-att-style="style">
<t t-att-style="style" t-raw="account.credit" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></a>
</span>
</div>
<!--## Ending balance-->
<div class="act_as_cell amount" style="width: 9.64%;"><span t-field="account.final_balance"/></div>
<div class="act_as_cell amount" style="width: 9.64%;">
<t t-set="domain"
t-value="[('account_id', '=', account.account_id.id)]"/>
<span>
<a t-att-data-domain="domain"
t-att-data-res-model="'account.move.line'"
class="o_account_financial_reports_web_action_multi"
t-att-style="style" >
<t t-att-style="style" t-raw="account.final_balance" t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></a>
</span>
</div>
</div>
</div>
</template>

View File

@@ -0,0 +1,169 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="account_financial_report.report_vat_report_qweb">
<t t-call="web.html_container">
<t t-foreach="docs" t-as="o">
<t t-call="account_financial_report.internal_layout" t-lang="user.lang">
<t t-call="account_financial_report.report_vat_report_base"/>
</t>
</t>
</t>
</template>
<template id="account_financial_report.report_vat_report_base">
<div class="page data_table">
<t t-set="title">VAT Report</t>
<div class="row">
<h4 class="mt0" t-esc="title or 'Odoo Report'"/>
</div>
<!-- Display filters -->
<t t-call="account_financial_report.report_vat_report_filters"/>
<div class="page_break"/>
<div class="act_as_table data_table" style="width: 100%;">
<!-- Display table headers for lines -->
<div class="act_as_thead">
<div class="act_as_row labels">
<!--## code-->
<div class="act_as_cell first_column" style="width: 5%;">Code</div>
<!--## name-->
<div class="act_as_cell" style="width: 65%;">Name</div>
<!--## net-->
<div class="act_as_cell" style="width: 15%;">Net</div>
<!--## tax-->
<div class="act_as_cell" style="width: 15%;">Tax</div>
</div>
</div>
<t t-foreach="o.taxtags_ids" t-as="tag">
<div class="act_as_row lines" style="font-weight: bold;">
<t t-if="tag.taxtag_id">
<t t-set="res_model" t-value="'account.account.tag'"/>
<t t-set="res_id" t-value="tag.taxtag_id.id"/>
</t>
<t t-if="tag.taxgroup_id">
<t t-set="res_model" t-value="'account.tax.group'"/>
<t t-set="res_id" t-value="tag.taxgroup_id.id"/>
</t>
<div class="act_as_cell left oe_tooltip_string" style="width: 5%;">
<span>
<a t-att-data-active-id="res_id"
t-att-data-res-model="res_model"
class="o_account_financial_reports_web_action"
t-att-style="style">
<t t-att-style="style" t-raw="tag.code"/></a>
</span>
</div>
<div class="act_as_cell left oe_tooltip_string" style="width: 65%;">
<span>
<a t-att-data-active-id="res_id"
t-att-data-res-model="res_model"
class="o_account_financial_reports_web_action"
t-att-style="style"><t t-att-style="style" t-raw="tag.name"/></a>
</span>
</div>
<div class="act_as_cell amount" style="width: 15%;">
<t t-set="domain"
t-value="[('tax_ids', 'in', [tax.tax_id.id for tax in tag.tax_ids]),
('date', '&gt;=', o.date_from),
('date', '&lt;=', o.date_to)]"/>
<span>
<a t-att-data-domain="domain"
t-att-data-res-model="'account.move.line'"
class="o_account_financial_reports_web_action_multi"
t-att-style="style">
<t t-att-style="style" t-raw="tag.net"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></a>
</span>
</div>
<div class="act_as_cell amount" style="width: 15%;">
<t t-set="domain"
t-value="[('tax_line_id', 'in', [tax.tax_id.id for tax in tag.tax_ids]),
('date', '&gt;=', o.date_from),
('date', '&lt;=', o.date_to),
('tax_exigible', '=', True)]"/>
<span>
<a t-att-data-domain="domain"
t-att-data-res-model="'account.move.line'"
class="o_account_financial_reports_web_action_multi"
t-att-style="style">
<t t-att-style="style" t-raw="tag.tax"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></a>
</span>
</div>
</div>
<t t-if="o.tax_detail">
<t t-foreach="tag.tax_ids" t-as="tax">
<t t-set="res_model" t-value="'account.tax'"/>
<div class="act_as_row lines">
<div class="act_as_cell" style="width: 5%;"/>
<div class="act_as_cell left oe_tooltip_string" style="padding-left: 20px; width: 65%;">
<span>
<a t-att-data-active-id="tax.tax_id.id"
t-att-data-res-model="res_model"
class="o_account_financial_reports_web_action"
t-att-style="style"><t t-att-style="style" t-raw="tax.name"/></a>
</span>
</div>
<div class="act_as_cell amount" style="width: 15%;">
<t t-set="domain"
t-value="[('tax_ids', 'in', tax.tax_id.ids),
('date', '&gt;=', o.date_from),
('date', '&lt;=', o.date_to),
('tax_exigible', '=', True)]"/>
<span>
<a t-att-data-domain="domain"
t-att-data-res-model="'account.move.line'"
class="o_account_financial_reports_web_action_multi"
t-att-style="style">
<t t-att-style="style" t-raw="tax.net"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></a>
</span>
</div>
<div class="act_as_cell amount" style="width: 15%;">
<t t-set="domain"
t-value="[('tax_line_id', '=', tax.tax_id.id),
('date', '&gt;=', o.date_from),
('date', '&lt;=', o.date_to),
('tax_exigible', '=', True)]"/>
<span>
<a t-att-data-domain="domain"
t-att-data-res-model="'account.move.line'"
class="o_account_financial_reports_web_action_multi"
t-att-style="style">
<t t-att-style="style" t-raw="tax.tax"
t-options="{'widget': 'monetary', 'display_currency': res_company.currency_id}"/></a>
</span>
</div>
</div>
</t>
</t>
</t>
</div>
</div>
</template>
<template id="account_financial_report.report_vat_report_filters">
<div class="act_as_table data_table" style="width: 100%;">
<div class="act_as_row labels">
<div class="act_as_cell">Date From</div>
<div class="act_as_cell">Date To</div>
<div class="act_as_cell">Based On</div>
</div>
<div class="act_as_row">
<div class="act_as_cell">
<span t-field="o.date_from"/>
</div>
<div class="act_as_cell">
<span t-field="o.date_to"/>
</div>
<div class="act_as_cell">
<span t-field="o.based_on"/>
</div>
</div>
</div>
</template>
</odoo>

View File

@@ -1,4 +1,5 @@
# ?? 2016 Julien Coux (Camptocamp)
# ?? 2018 Forest and Biomass Romania SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import models, fields, api
@@ -10,8 +11,8 @@ class TrialBalanceReport(models.TransientModel):
The class hierarchy is :
* TrialBalanceReport
** TrialBalanceReportAccount
*** TrialBalanceReportPartner
*** TrialBalanceReportAccount
**** TrialBalanceReportPartner
If "show_partner_details" is selected
"""
@@ -27,6 +28,11 @@ class TrialBalanceReport(models.TransientModel):
filter_account_ids = fields.Many2many(comodel_name='account.account')
filter_partner_ids = fields.Many2many(comodel_name='res.partner')
show_partner_details = fields.Boolean()
hierarchy_on = fields.Selection([('computed', 'Computed Accounts'),
('relation', 'Child Accounts')],
string='Hierarchy On',
required=True,
default='computed')
# General Ledger Report Data fields,
# used as base for compute the data reports
@@ -43,7 +49,7 @@ class TrialBalanceReport(models.TransientModel):
class TrialBalanceReportAccount(models.TransientModel):
_name = 'report_trial_balance_account'
_order = 'code ASC'
_order = 'sequence, code ASC, name'
report_id = fields.Many2one(
comodel_name='report_trial_balance',
@@ -51,12 +57,30 @@ class TrialBalanceReportAccount(models.TransientModel):
index=True
)
# Data fields, used to keep link with real object
sequence = fields.Integer(index=True, default=0)
level = fields.Integer(index=True, default=0)
# Data fields, used to keep link with real object
account_id = fields.Many2one(
'account.account',
index=True
)
account_group_id = fields.Many2one(
'account.group',
index=True
)
parent_id = fields.Many2one(
'account.group',
index=True
)
child_account_ids = fields.Char(
string="Accounts")
compute_account_ids = fields.Many2many(
'account.account',
string="Accounts", store=True)
# Data fields, used for report display
code = fields.Char()
name = fields.Char()
@@ -138,14 +162,14 @@ class TrialBalanceReportCompute(models.TransientModel):
rcontext['o'] = report
result['html'] = self.env.ref(
'account_financial_report.report_trial_balance').render(
rcontext)
rcontext)
return result
@api.model
def get_html(self, given_context=None):
return self._get_html()
def _prepare_report_general_ledger(self):
def _prepare_report_general_ledger(self, account_ids):
self.ensure_one()
return {
'date_from': self.date_from,
@@ -153,7 +177,7 @@ class TrialBalanceReportCompute(models.TransientModel):
'only_posted_moves': self.only_posted_moves,
'hide_account_balance_at_0': self.hide_account_balance_at_0,
'company_id': self.company_id.id,
'filter_account_ids': [(6, 0, self.filter_account_ids.ids)],
'filter_account_ids': [(6, 0, account_ids.ids)],
'filter_partner_ids': [(6, 0, self.filter_partner_ids.ids)],
'fy_start_date': self.fy_start_date,
}
@@ -165,21 +189,38 @@ class TrialBalanceReportCompute(models.TransientModel):
# The data of Trial Balance Report
# are based on General Ledger Report data.
model = self.env['report_general_ledger']
if self.filter_account_ids:
account_ids = self.filter_account_ids
else:
account_ids = self.env['account.account'].search(
[('company_id', '=', self.company_id.id)])
self.general_ledger_id = model.create(
self._prepare_report_general_ledger()
self._prepare_report_general_ledger(account_ids)
)
self.general_ledger_id.compute_data_for_report(
with_line_details=False, with_partners=self.show_partner_details
)
# Compute report data
self._inject_account_values()
self._inject_account_values(account_ids)
if self.show_partner_details:
self._inject_partner_values()
# Refresh cache because all data are computed with SQL requests
if not self.filter_account_ids:
self._inject_account_group_values()
if self.hierarchy_on == 'computed':
self._update_account_group_computed_values()
else:
self._update_account_group_child_values()
self._update_account_sequence()
self._add_account_group_account_values()
self.refresh()
if not self.filter_account_ids:
self._compute_group_accounts()
else:
for line in self.account_ids:
line.write({'level': 0})
def _inject_account_values(self):
def _inject_account_values(self, account_ids):
"""Inject report values for report_trial_balance_account"""
query_inject_account = """
INSERT INTO
@@ -189,6 +230,7 @@ INSERT INTO
create_uid,
create_date,
account_id,
parent_id,
code,
name,
initial_balance,
@@ -200,22 +242,29 @@ SELECT
%s AS report_id,
%s AS create_uid,
NOW() AS create_date,
rag.account_id,
rag.code,
rag.name,
rag.initial_balance AS initial_balance,
rag.final_debit - rag.initial_debit AS debit,
rag.final_credit - rag.initial_credit AS credit,
rag.final_balance AS final_balance
acc.id,
acc.group_id,
acc.code,
acc.name,
coalesce(rag.initial_balance, 0) AS initial_balance,
coalesce(rag.final_debit - rag.initial_debit, 0) AS debit,
coalesce(rag.final_credit - rag.initial_credit, 0) AS credit,
coalesce(rag.final_balance, 0) AS final_balance
FROM
report_general_ledger_account rag
account_account acc
LEFT OUTER JOIN report_general_ledger_account AS rag
ON rag.account_id = acc.id AND rag.report_id = %s
WHERE
rag.report_id = %s
acc.id in %s
"""
if self.hide_account_balance_at_0:
query_inject_account += """ AND
final_balance IS NOT NULL AND final_balance != 0"""
query_inject_account_params = (
self.id,
self.env.uid,
self.general_ledger_id.id,
account_ids._ids,
)
self.env.cr.execute(query_inject_account, query_inject_account_params)
@@ -261,3 +310,179 @@ AND ra.report_id = %s
self.id,
)
self.env.cr.execute(query_inject_partner, query_inject_partner_params)
def _inject_account_group_values(self):
"""Inject report values for report_trial_balance_account"""
query_inject_account_group = """
INSERT INTO
report_trial_balance_account
(
report_id,
create_uid,
create_date,
account_group_id,
parent_id,
code,
name,
sequence,
level
)
SELECT
%s AS report_id,
%s AS create_uid,
NOW() AS create_date,
accgroup.id,
accgroup.parent_id,
coalesce(accgroup.code_prefix, accgroup.name),
accgroup.name,
accgroup.parent_left * 100000,
accgroup.level
FROM
account_group accgroup"""
query_inject_account_params = (
self.id,
self.env.uid,
)
self.env.cr.execute(query_inject_account_group,
query_inject_account_params)
def _update_account_group_child_values(self):
"""Compute values for report_trial_balance_account group in child."""
query_update_account_group = """
WITH computed AS (WITH RECURSIVE cte AS (
SELECT account_group_id, code, account_group_id AS parent_id,
initial_balance, debit, credit, final_balance
FROM report_trial_balance_account
WHERE report_id = %s
GROUP BY report_trial_balance_account.id
UNION ALL
SELECT c.account_group_id, c.code, p.account_group_id,
p.initial_balance, p.debit, p.credit, p.final_balance
FROM cte c
JOIN report_trial_balance_account p USING (parent_id)
WHERE p.report_id = %s
)
SELECT account_group_id, code,
sum(initial_balance) AS initial_balance, sum(debit) AS debit,
sum(credit) AS credit, sum(final_balance) AS final_balance
FROM cte
GROUP BY cte.account_group_id, cte.code
ORDER BY account_group_id
)
UPDATE report_trial_balance_account
SET initial_balance = computed.initial_balance,
debit = computed.debit,
credit = computed.credit,
final_balance = computed.final_balance
FROM computed
WHERE report_trial_balance_account.account_group_id = computed.account_group_id
AND report_trial_balance_account.report_id = %s
"""
query_update_account_params = (self.id, self.id, self.id,)
self.env.cr.execute(query_update_account_group,
query_update_account_params)
def _add_account_group_account_values(self):
"""Compute values for report_trial_balance_account group in child."""
query_update_account_group = """
DROP AGGREGATE IF EXISTS array_concat_agg(anyarray);
CREATE AGGREGATE array_concat_agg(anyarray) (
SFUNC = array_cat,
STYPE = anyarray
);
WITH aggr AS(WITH computed AS (WITH RECURSIVE cte AS (
SELECT account_group_id, account_group_id AS parent_id,
ARRAY[account_id]::int[] as child_account_ids
FROM report_trial_balance_account
WHERE report_id = %s
GROUP BY report_trial_balance_account.id
UNION ALL
SELECT c.account_group_id, p.account_group_id, ARRAY[p.account_id]::int[]
FROM cte c
JOIN report_trial_balance_account p USING (parent_id)
WHERE p.report_id = %s
)
SELECT account_group_id,
array_concat_agg(DISTINCT child_account_ids)::int[] as child_account_ids
FROM cte
GROUP BY cte.account_group_id, cte.child_account_ids
ORDER BY account_group_id
)
SELECT account_group_id,
array_concat_agg(DISTINCT child_account_ids)::int[]
AS child_account_ids from computed
GROUP BY account_group_id)
UPDATE report_trial_balance_account
SET child_account_ids = aggr.child_account_ids
FROM aggr
WHERE report_trial_balance_account.account_group_id = aggr.account_group_id
AND report_trial_balance_account.report_id = %s
"""
query_update_account_params = (self.id, self.id, self.id,)
self.env.cr.execute(query_update_account_group,
query_update_account_params)
def _update_account_group_computed_values(self):
"""Compute values for report_trial_balance_account group in compute."""
query_update_account_group = """
WITH RECURSIVE accgroup AS
(SELECT
accgroup.id,
coalesce(sum(ra.initial_balance),0) as initial_balance,
coalesce(sum(ra.debit),0) as debit,
coalesce(sum(ra.credit),0) as credit,
coalesce(sum(ra.final_balance),0) as final_balance
FROM
account_group accgroup
LEFT OUTER JOIN account_account AS acc
ON strpos(acc.code, accgroup.code_prefix) = 1
LEFT OUTER JOIN report_trial_balance_account AS ra
ON ra.account_id = acc.id
WHERE ra.report_id = %s
GROUP BY accgroup.id
)
UPDATE report_trial_balance_account
SET initial_balance = accgroup.initial_balance,
debit = accgroup.debit,
credit = accgroup.credit,
final_balance = accgroup.final_balance
FROM accgroup
WHERE report_trial_balance_account.account_group_id = accgroup.id
"""
query_update_account_params = (self.id,)
self.env.cr.execute(query_update_account_group,
query_update_account_params)
def _update_account_sequence(self):
"""Compute sequence, level for report_trial_balance_account account."""
query_update_account_group = """
UPDATE report_trial_balance_account
SET sequence = newline.sequence + 1,
level = newline.level + 1
FROM report_trial_balance_account as newline
WHERE newline.account_group_id = report_trial_balance_account.parent_id
AND report_trial_balance_account.report_id = newline.report_id
AND report_trial_balance_account.account_id is not null
AND report_trial_balance_account.report_id = %s"""
query_update_account_params = (self.id,)
self.env.cr.execute(query_update_account_group,
query_update_account_params)
def _compute_group_accounts(self):
groups = self.account_ids.filtered(
lambda a: a.account_group_id is not False)
for group in groups:
if self.hierarchy_on == 'compute':
group.compute_account_ids = \
group.account_group_id.compute_account_ids
else:
if group.child_account_ids:
chacc = group.child_account_ids.replace(
'}', '').replace('{', '').split(',')
if 'NULL' in chacc:
chacc.remove('NULL')
if chacc:
group.compute_account_ids = [
(6, 0, [int(g) for g in chacc])]

View File

@@ -1,4 +1,3 @@
# Author: Julien Coux
# Copyright 2016 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
@@ -60,12 +59,12 @@ class TrialBalanceXslx(models.AbstractModel):
def _get_report_filters(self, report):
return [
[_('Date range filter'),
_('From: %s To: %s') % (report.date_from, report.date_to)],
_('From: %s To: %s') % (report.date_from, report.date_to)],
[_('Target moves filter'),
_('All posted entries') if report.only_posted_moves
else _('All entries')],
_('All posted entries') if report.only_posted_moves else _(
'All entries')],
[_('Account balance at 0 filter'),
_('Hide') if report.hide_account_balance_at_0 else _('Show')],
_('Hide') if report.hide_account_balance_at_0 else _('Show')],
]
def _get_col_count_filter_name(self):

View File

@@ -0,0 +1,351 @@
# Copyright 2018 Forest and Biomass Romania
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import api, fields, models
class VATReport(models.TransientModel):
_name = "report_vat_report"
""" Here, we just define class fields.
For methods, go more bottom at this file.
The class hierarchy is :
* VATReport
** VATReportTaxTags
*** VATReportTax
"""
# Filters fields, used for data computation
company_id = fields.Many2one(comodel_name='res.company')
date_from = fields.Date()
date_to = fields.Date()
based_on = fields.Selection([('taxtags', 'Tax Tags'),
('taxgroups', 'Tax Groups')],
string='Based On',
required=True,
default='taxtags')
tax_detail = fields.Boolean('Tax Detail')
# Data fields, used to browse report data
taxtags_ids = fields.One2many(
comodel_name='report_vat_report_taxtag',
inverse_name='report_id'
)
class VATReportTaxTags(models.TransientModel):
_name = 'report_vat_report_taxtag'
_order = 'code ASC'
report_id = fields.Many2one(
comodel_name='report_vat_report',
ondelete='cascade',
index=True
)
# Data fields, used to keep link with real object
taxtag_id = fields.Many2one(
'account.account.tag',
index=True
)
taxgroup_id = fields.Many2one(
'account.tax.group',
index=True
)
# Data fields, used for report display
code = fields.Char()
name = fields.Char()
net = fields.Float(digits=(16, 2))
tax = fields.Float(digits=(16, 2))
# Data fields, used to browse report data
tax_ids = fields.One2many(
comodel_name='report_vat_report_tax',
inverse_name='report_tax_id'
)
class VATReportTax(models.TransientModel):
_name = 'report_vat_report_tax'
_order = 'name ASC'
report_tax_id = fields.Many2one(
comodel_name='report_vat_report_taxtag',
ondelete='cascade',
index=True
)
# Data fields, used to keep link with real object
tax_id = fields.Many2one(
'account.tax',
index=True
)
# Data fields, used for report display
code = fields.Char()
name = fields.Char()
net = fields.Float(digits=(16, 2))
tax = fields.Float(digits=(16, 2))
class VATReportCompute(models.TransientModel):
""" Here, we just define methods.
For class fields, go more top at this file.
"""
_inherit = 'report_vat_report'
@api.multi
def print_report(self, report_type='qweb'):
self.ensure_one()
if report_type == 'xlsx':
report_name = 'a_f_r.report_vat_report_xlsx'
else:
report_name = 'account_financial_report.report_vat_report_qweb'
context = dict(self.env.context)
action = self.env['ir.actions.report'].search(
[('report_name', '=', report_name),
('report_type', '=', report_type)], limit=1)
return action.with_context(context).report_action(self)
def _get_html(self):
result = {}
rcontext = {}
context = dict(self.env.context)
report = self.browse(context.get('active_id'))
if report:
rcontext['o'] = report
result['html'] = self.env.ref(
'account_financial_report.report_vat_report').render(
rcontext)
return result
@api.model
def get_html(self, given_context=None):
return self.with_context(given_context)._get_html()
@api.multi
def compute_data_for_report(self):
self.ensure_one()
# Compute report data
if self.based_on == 'taxtags':
self._inject_taxtags_values()
self._inject_tax_taxtags_values()
elif self.based_on == 'taxgroups':
self._inject_taxgroups_values()
self._inject_tax_taxgroups_values()
# Refresh cache because all data are computed with SQL requests
self.refresh()
def _inject_taxtags_values(self):
"""Inject report values for report_vat_report_taxtags."""
query_inject_taxtags = """
WITH
taxtags AS
(SELECT coalesce(regexp_replace(tag.name,
'[^0-9\\.]+', '', 'g'), ' ') AS code,
tag.name, tag.id,
coalesce(sum(movetax.tax_base_amount), 0.00) AS net,
coalesce(sum(movetax.balance), 0.00) AS tax
FROM
account_account_tag AS tag
INNER JOIN account_tax_account_tag AS taxtag
ON tag.id = taxtag.account_account_tag_id
INNER JOIN account_tax AS tax
ON tax.id = taxtag.account_tax_id
INNER JOIN account_move_line AS movetax
ON movetax.tax_line_id = tax.id
INNER JOIN account_move AS move
ON move.id = movetax.move_id
WHERE tag.id is not null AND movetax.tax_exigible
AND move.company_id = %s AND move.date >= %s
AND move.date <= %s AND move.state = 'posted'
GROUP BY tag.id
ORDER BY code, tag.name
)
INSERT INTO
report_vat_report_taxtag
(
report_id,
create_uid,
create_date,
taxtag_id,
code,
name,
net, tax
)
SELECT
%s AS report_id,
%s AS create_uid,
NOW() AS create_date,
tag.id,
tag.code,
tag.name,
abs(tag.net),
abs(tag.tax)
FROM
taxtags tag
"""
query_inject_taxtags_params = (self.company_id.id, self.date_from,
self.date_to, self.id, self.env.uid)
self.env.cr.execute(query_inject_taxtags, query_inject_taxtags_params)
def _inject_taxgroups_values(self):
"""Inject report values for report_vat_report_taxtags."""
query_inject_taxgroups = """
WITH
taxgroups AS
(SELECT coalesce(taxgroup.sequence, 0) AS code,
taxgroup.name, taxgroup.id,
coalesce(sum(movetax.tax_base_amount), 0.00) AS net,
coalesce(sum(movetax.balance), 0.00) AS tax
FROM
account_tax_group AS taxgroup
INNER JOIN account_tax AS tax
ON tax.tax_group_id = taxgroup.id
INNER JOIN account_move_line AS movetax
ON movetax.tax_line_id = tax.id
INNER JOIN account_move AS move
ON move.id = movetax.move_id
WHERE taxgroup.id is not null AND movetax.tax_exigible
AND move.company_id = %s AND move.date >= %s
AND move.date <= %s AND move.state = 'posted'
GROUP BY taxgroup.id
ORDER BY code, taxgroup.name
)
INSERT INTO
report_vat_report_taxtag
(
report_id,
create_uid,
create_date,
taxgroup_id,
code,
name,
net, tax
)
SELECT
%s AS report_id,
%s AS create_uid,
NOW() AS create_date,
groups.id,
groups.code,
groups.name,
abs(groups.net),
abs(groups.tax)
FROM
taxgroups groups
"""
query_inject_taxgroups_params = (self.company_id.id, self.date_from,
self.date_to, self.id, self.env.uid)
self.env.cr.execute(query_inject_taxgroups,
query_inject_taxgroups_params)
def _inject_tax_taxtags_values(self):
""" Inject report values for report_vat_report_tax. """
# pylint: disable=sql-injection
query_inject_tax = """
WITH
taxtags_tax AS
(
SELECT
tag.id AS report_tax_id, ' ' AS code,
tax.name, tax.id,
coalesce(sum(movetax.tax_base_amount), 0.00) AS net,
coalesce(sum(movetax.balance), 0.00) AS tax
FROM
report_vat_report_taxtag AS tag
INNER JOIN account_tax_account_tag AS taxtag
ON tag.taxtag_id = taxtag.account_account_tag_id
INNER JOIN account_tax AS tax
ON tax.id = taxtag.account_tax_id
INNER JOIN account_move_line AS movetax
ON movetax.tax_line_id = tax.id
INNER JOIN account_move AS move
ON move.id = movetax.move_id
WHERE tag.id is not null AND movetax.tax_exigible
AND tag.report_id = %s AND move.company_id = %s
AND move.date >= %s AND move.date <= %s
AND move.state = 'posted'
GROUP BY tag.id, tax.id
ORDER BY tax.name
)
INSERT INTO
report_vat_report_tax
(
report_tax_id,
create_uid,
create_date,
tax_id,
name,
net,
tax
)
SELECT
tt.report_tax_id,
%s AS create_uid,
NOW() AS create_date,
tt.id,
tt.name,
abs(tt.net),
abs(tt.tax)
FROM
taxtags_tax tt
"""
query_inject_tax_params = (self.id, self.company_id.id, self.date_from,
self.date_to, self.env.uid)
self.env.cr.execute(query_inject_tax, query_inject_tax_params)
def _inject_tax_taxgroups_values(self):
""" Inject report values for report_vat_report_tax. """
# pylint: disable=sql-injection
query_inject_tax = """
WITH
taxtags_tax AS
(
SELECT
taxtag.id AS report_tax_id, ' ' AS code,
tax.name, tax.id,
coalesce(sum(movetax.tax_base_amount), 0.00) AS net,
coalesce(sum(movetax.balance), 0.00) AS tax
FROM
report_vat_report_taxtag AS taxtag
INNER JOIN account_tax AS tax
ON tax.tax_group_id = taxtag.taxgroup_id
INNER JOIN account_move_line AS movetax
ON movetax.tax_line_id = tax.id
INNER JOIN account_move AS move
ON move.id = movetax.move_id
WHERE taxtag.id is not null AND movetax.tax_exigible
AND taxtag.report_id = %s AND move.company_id = %s
AND move.date >= %s AND move.date <= %s
AND move.state = 'posted'
GROUP BY taxtag.id, tax.id
ORDER BY tax.name
)
INSERT INTO
report_vat_report_tax
(
report_tax_id,
create_uid,
create_date,
tax_id,
name,
net,
tax
)
SELECT
tt.report_tax_id,
%s AS create_uid,
NOW() AS create_date,
tt.id,
tt.name,
abs(tt.net),
abs(tt.tax)
FROM
taxtags_tax tt
"""
query_inject_tax_params = (self.id, self.company_id.id, self.date_from,
self.date_to, self.env.uid)
self.env.cr.execute(query_inject_tax, query_inject_tax_params)

View File

@@ -0,0 +1,51 @@
# Copyright 2018 Forest and Biomass Romania
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import _, models
class VATReportXslx(models.AbstractModel):
_name = 'report.a_f_r.report_vat_report_xlsx'
_inherit = 'report.account_financial_report.abstract_report_xlsx'
def _get_report_name(self):
return _('VAT Report')
def _get_report_columns(self, report):
return {
0: {'header': _('Code'), 'field': 'code', 'width': 5},
1: {'header': _('Name'), 'field': 'name', 'width': 100},
2: {'header': _('Net'),
'field': 'net',
'type': 'amount',
'width': 14},
3: {'header': _('Tax'),
'field': 'tax',
'type': 'amount',
'width': 14},
}
def _get_report_filters(self, report):
return [
[_('Date from'), report.date_from],
[_('Date to'), report.date_to],
[_('Based on'), report.based_on],
]
def _get_col_count_filter_name(self):
return 0
def _get_col_count_filter_value(self):
return 2
def _generate_report_content(self, workbook, report):
# For each taxtag
self.write_array_header()
for taxtag in report.taxtags_ids:
# Write taxtag line
self.write_line(taxtag)
# For each tax if detail taxes
if report.tax_detail:
for tax in taxtag.tax_ids:
self.write_line(tax)