Browse Source

Merge f5ff2eb49a into 0aa3d6c1ae

pull/585/merge
Tonow-c2c 3 years ago
committed by GitHub
parent
commit
725792a7b2
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      account_financial_report/report/aged_partner_balance.py
  2. 5
      account_financial_report/report/general_ledger.py
  3. 3
      account_financial_report/report/journal_ledger.py
  4. 3
      account_financial_report/report/open_items.py
  5. 4
      account_financial_report/report/templates/aged_partner_balance.xml
  6. 4
      account_financial_report/report/templates/general_ledger.xml
  7. 4
      account_financial_report/report/templates/journal_ledger.xml
  8. 4
      account_financial_report/report/templates/open_items.xml
  9. 4
      account_financial_report/report/templates/trial_balance.xml
  10. 3
      account_financial_report/report/trial_balance.py
  11. 18
      account_financial_report/reports.xml
  12. 13
      account_financial_report/tests/abstract_test.py
  13. 3
      account_financial_report/tests/test_aged_partner_balance.py
  14. 3
      account_financial_report/tests/test_general_ledger.py
  15. 7
      account_financial_report/tests/test_journal_ledger.py
  16. 3
      account_financial_report/tests/test_open_items.py
  17. 3
      account_financial_report/tests/test_trial_balance.py

3
account_financial_report/report/aged_partner_balance.py

@ -189,6 +189,9 @@ class AgedPartnerBalanceReportCompute(models.TransientModel):
self.ensure_one()
if report_type == 'xlsx':
report_name = 'a_f_r.report_aged_partner_balance_xlsx'
elif report_type == 'qweb-html':
report_name = 'account_financial_report.' \
'report_aged_partner_balance_html_qweb'
else:
report_name = 'account_financial_report.' \
'report_aged_partner_balance_qweb'

5
account_financial_report/report/general_ledger.py

@ -219,6 +219,9 @@ class GeneralLedgerReportCompute(models.TransientModel):
self.ensure_one()
if report_type == 'xlsx':
report_name = 'a_f_r.report_general_ledger_xlsx'
elif report_type == 'qweb-html':
report_name = 'account_financial_report.' \
'report_general_ledger_html_qweb'
else:
report_name = 'account_financial_report.' \
'report_general_ledger_qweb'
@ -1224,7 +1227,7 @@ LEFT JOIN
account_analytic_account aa ON ml.analytic_account_id = aa.id
"""
if self.filter_analytic_tag_ids:
query_inject_move_line += """
query_inject_move_line += """
INNER JOIN
move_lines_on_tags ON ml.id = move_lines_on_tags.ml_id
"""

3
account_financial_report/report/journal_ledger.py

@ -589,6 +589,9 @@ class ReportJournalLedger(models.TransientModel):
self.ensure_one()
if report_type == 'xlsx':
report_name = 'a_f_r.report_journal_ledger_xlsx'
elif report_type == 'qweb-html':
report_name = 'account_financial_report.' \
'report_journal_ledger_html_qweb'
else:
report_name = 'account_financial_report.' \
'report_journal_ledger_qweb'

3
account_financial_report/report/open_items.py

@ -155,6 +155,9 @@ class OpenItemsReportCompute(models.TransientModel):
self.ensure_one()
if report_type == 'xlsx':
report_name = 'a_f_r.report_open_items_xlsx'
elif report_type == 'qweb-html':
report_name = 'account_financial_report.' \
'report_open_items_html_qweb'
else:
report_name = 'account_financial_report.' \
'report_open_items_qweb'

4
account_financial_report/report/templates/aged_partner_balance.xml

@ -11,6 +11,10 @@
</t>
</template>
<template id="report_aged_partner_balance_html_qweb">
<t t-call="account_financial_report.report_aged_partner_balance_qweb"/>
</template>
<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"/>

4
account_financial_report/report/templates/general_ledger.xml

@ -11,6 +11,10 @@
</t>
</template>
<template id="report_general_ledger_html_qweb">
<t t-call="account_financial_report.report_general_ledger_qweb"/>
</template>
<template id="report_general_ledger_base">
<!-- Saved flag fields into variables, used to define columns display -->
<t t-set="show_analytic_tags" t-value="o.show_analytic_tags"/>

4
account_financial_report/report/templates/journal_ledger.xml

@ -11,6 +11,10 @@
</t>
</template>
<template id="report_journal_ledger_html_qweb">
<t t-call="account_financial_report.report_journal_ledger_qweb"/>
</template>
<template id="report_journal_ledger_base">
<t t-set="display_currency" t-value="o.foreign_currency"/>
<t t-set="display_account_name" t-value="o.with_account_name"/>

4
account_financial_report/report/templates/open_items.xml

@ -11,6 +11,10 @@
</t>
</template>
<template id="account_financial_report.report_open_items_html_qweb">
<t t-call="account_financial_report.report_open_items_qweb"/>
</template>
<template id="account_financial_report.report_open_items_base">
<!-- Saved flag fields into variables, used to define columns display -->
<t t-set="foreign_currency" t-value="o.foreign_currency"/>

4
account_financial_report/report/templates/trial_balance.xml

@ -11,6 +11,10 @@
</t>
</template>
<template id="report_trial_balance_html_qweb">
<t t-call="account_financial_report.report_trial_balance_qweb"/>
</template>
<template id="account_financial_report.report_trial_balance_base">
<!-- Saved flag fields into variables, used to define columns display -->
<t t-set="show_partner_details" t-value="o.show_partner_details"/>

3
account_financial_report/report/trial_balance.py

@ -204,6 +204,9 @@ class TrialBalanceReportCompute(models.TransientModel):
self.ensure_one()
if report_type == 'xlsx':
report_name = 'a_f_r.report_trial_balance_xlsx'
elif report_type == 'qweb-html':
report_name = 'account_financial_report.' \
'report_trial_balance_html_qweb'
else:
report_name = 'account_financial_report.' \
'report_trial_balance_qweb'

18
account_financial_report/reports.xml

@ -17,10 +17,10 @@
model="report_general_ledger"
string="General Ledger"
report_type="qweb-html"
name="account_financial_report.report_general_ledger_qweb"
name="account_financial_report.report_general_ledger_html_qweb"
file="account_financial_report.report_general_ledger_html"
/>
<!-- Journal Ledger -->
<report
id="action_report_journal_ledger_qweb"
@ -35,7 +35,7 @@
model="report_journal_ledger"
string="Journal Ledger"
report_type="qweb-html"
name="account_financial_report.report_journal_ledger_qweb"
name="account_financial_report.report_journal_ledger_html_qweb"
file="account_financial_report.report_journal_ledger_html"
/>
@ -53,7 +53,7 @@
model="report_trial_balance"
string="Trial Balance"
report_type="qweb-html"
name="account_financial_report.report_trial_balance_qweb"
name="account_financial_report.report_trial_balance_html_qweb"
file="account_financial_report.report_trial_balance_html"
/>
@ -71,7 +71,7 @@
model="report_open_items"
string="Open Items"
report_type="qweb-html"
name="account_financial_report.report_open_items_qweb"
name="account_financial_report.report_open_items_html_qweb"
file="account_financial_report.report_open_items_html"
/>
@ -89,7 +89,7 @@
model="report_aged_partner_balance"
string="Aged Partner Balance"
report_type="qweb-html"
name="account_financial_report.report_aged_partner_balance_qweb"
name="account_financial_report.report_aged_partner_balance_html_qweb"
file="account_financial_report.report_aged_partner_balance_html"
/>
@ -110,7 +110,7 @@
name="account_financial_report.report_vat_report_qweb"
file="account_financial_report.report_vat_report_html"
/>
<!-- PDF REPORTS : paperformat -->
<record id="report_qweb_paperformat" model="report.paperformat">
@ -145,7 +145,7 @@
model="ir.actions.report">
<field name="paperformat_id" ref="report_qweb_paperformat"/>
</record>
<record id="action_report_vat_report_qweb"
model="ir.actions.report">
<field name="paperformat_id" ref="report_qweb_paperformat"/>
@ -197,7 +197,7 @@
<field name="report_type">xlsx</field>
<field name="report_file">report_aged_partner_balance</field>
</record>
<record id="action_report_vat_report_xlsx" model="ir.actions.report">
<field name="name">VAT Report XLSX</field>
<field name="model">report_vat_report</field>

13
account_financial_report/tests/abstract_test.py

@ -213,6 +213,7 @@ class AbstractTest(common.TransactionCase):
self.model = self._getReportModel()
self.qweb_report_name = self._getQwebReportName()
self.html_report_name = self._getHtmlReportName()
self.xlsx_report_name = self._getXlsxReportName()
self.xlsx_action_name = self._getXlsxReportActionName()
@ -226,7 +227,7 @@ class AbstractTest(common.TransactionCase):
def test_html(self):
test_reports.try_report(self.env.cr, self.env.uid,
self.qweb_report_name,
self.html_report_name,
[self.report.id],
report_type='qweb-html')
@ -255,7 +256,7 @@ class AbstractTest(common.TransactionCase):
self.assertDictContainsSubset(
{
'type': 'ir.actions.report',
'report_name': self.qweb_report_name,
'report_name': self.html_report_name,
'report_type': 'qweb-html',
},
report_action
@ -263,7 +264,7 @@ class AbstractTest(common.TransactionCase):
# Check if report template is correct
report = self.env['ir.actions.report'].search(
[('report_name', '=', self.qweb_report_name),
[('report_name', '=', self.html_report_name),
('report_type', '=', report_type)], limit=1)
self.assertEqual(report.report_type, 'qweb-html')
@ -377,6 +378,12 @@ class AbstractTest(common.TransactionCase):
"""
raise NotImplementedError()
def _getHtmlReportName(self):
"""
:return: the html report name
"""
raise NotImplementedError()
def _getXlsxReportName(self):
"""
:return: the xlsx report name

3
account_financial_report/tests/test_aged_partner_balance.py

@ -17,6 +17,9 @@ class TestAgedPartnerBalance(abstract_test.AbstractTest):
def _getQwebReportName(self):
return 'account_financial_report.report_aged_partner_balance_qweb'
def _getHtmlReportName(self):
return 'account_financial_report.report_aged_partner_balance_html_qweb'
def _getXlsxReportName(self):
return 'a_f_r.report_aged_partner_balance_xlsx'

3
account_financial_report/tests/test_general_ledger.py

@ -19,6 +19,9 @@ class TestGeneralLedger(a_t_f_c.AbstractTestForeignCurrency):
def _getQwebReportName(self):
return 'account_financial_report.report_general_ledger_qweb'
def _getHtmlReportName(self):
return 'account_financial_report.report_general_ledger_html_qweb'
def _getXlsxReportName(self):
return 'a_f_r.report_general_ledger_xlsx'

7
account_financial_report/tests/test_journal_ledger.py

@ -22,6 +22,9 @@ class TestJournalLedger(a_t_f_c.AbstractTestForeignCurrency):
def _getQwebReportName(self):
return 'account_financial_report.report_journal_ledger_qweb'
def _getHtmlReportName(self):
return 'account_financial_report.report_journal_ledger_html_qweb'
def _getXlsxReportName(self):
return 'a_f_r.report_journal_ledger_xlsx'
@ -58,7 +61,7 @@ class TestJournalLedger(a_t_f_c.AbstractTestForeignCurrency):
self.assertDictContainsSubset(
{
'type': 'ir.actions.report',
'report_name': self.qweb_report_name,
'report_name': self.html_report_name,
'report_type': 'qweb-html',
},
report_action
@ -66,7 +69,7 @@ class TestJournalLedger(a_t_f_c.AbstractTestForeignCurrency):
# Check if report template is correct
report = self.env['ir.actions.report'].search(
[('report_name', '=', self.qweb_report_name),
[('report_name', '=', self.html_report_name),
('report_type', '=', report_type)], limit=1)
self.assertEqual(report.report_type, 'qweb-html')

3
account_financial_report/tests/test_open_items.py

@ -17,6 +17,9 @@ class TestOpenItems(a_t_f_c.AbstractTestForeignCurrency):
def _getQwebReportName(self):
return 'account_financial_report.report_open_items_qweb'
def _getHtmlReportName(self):
return 'account_financial_report.report_open_items_html_qweb'
def _getXlsxReportName(self):
return 'a_f_r.report_open_items_xlsx'

3
account_financial_report/tests/test_trial_balance.py

@ -19,6 +19,9 @@ class TestTrialBalance(a_t_f_c.AbstractTestForeignCurrency):
def _getQwebReportName(self):
return 'account_financial_report.report_trial_balance_qweb'
def _getHtmlReportName(self):
return 'account_financial_report.report_trial_balance_html_qweb'
def _getXlsxReportName(self):
return 'a_f_r.report_trial_balance_xlsx'

Loading…
Cancel
Save