forked from OCA/reporting-engine
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request OCA#7 from acsone/9.0-import_report_py3o
Add simple tests and fix call to fusion server
- Loading branch information
Showing
10 changed files
with
75 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
,lmi,nbacsonelmi,04.10.2016 15:56,file:///home/lmi/.config/libreoffice/4; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- Copyright 2016 ACSONE SA/NV | ||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). --> | ||
|
||
<odoo> | ||
|
||
<record id="res_users_report_py3o" model="ir.actions.report.xml"> | ||
<field name="name">Py3o Demo Report</field> | ||
<field name="type">ir.actions.report.xml</field> | ||
<field name="model">res.users</field> | ||
<field name="report_name">py3o_user_info</field> | ||
<field name="report_type">py3o</field> | ||
<field name="py3o_filetype">odt</field> | ||
<field name="py3o_is_local_fusion" eval="1"/> | ||
<field name="py3o_filetype">odt</field> | ||
<field name="module">report_py3o</field> | ||
<field name="py3o_template_fallback">demo/res_user.odt</field> | ||
</record> | ||
|
||
<record id="res_users_report_py3o_print_action" model="ir.values"> | ||
<field eval="'action'" name="key" /> | ||
<field eval="'client_print_multi'" name="key2" /> | ||
<field name="model">res.users</field> | ||
<field name="name">Py3o Demo Report</field> | ||
<field eval="'ir.actions.report.xml,'+str(res_users_report_py3o)" name="value" /> | ||
</record> | ||
|
||
</odoo> |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import test_report_py3o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright 2016 ACSONE SA/NV | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).). | ||
|
||
|
||
import mock | ||
|
||
from openerp.tests.common import TransactionCase | ||
import openerp.tests | ||
|
||
|
||
@openerp.tests.common.at_install(False) | ||
@openerp.tests.common.post_install(True) | ||
class TestReportPy3o(TransactionCase): | ||
|
||
def test_reports(self): | ||
domain = [('report_type', '=', 'py3o'), | ||
('report_name', '=', 'py3o_user_info')] | ||
reports = self.env['ir.actions.report.xml'].search(domain) | ||
self.assertEqual(1, len(reports)) | ||
for r in reports: | ||
with mock.patch('openerp.addons.report_py3o.py3o_parser.' | ||
'Py3oParser.create_single_pdf') as patched_pdf: | ||
r.render_report(self.env.user.ids, | ||
r.report_name, | ||
{}) | ||
self.assertEqual(1, patched_pdf.call_count) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters