Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX][account_financial_report_qweb] Fix ImportError. #229

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions account_financial_report_qweb/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ Contributors
* Francesco Apruzzese <[email protected]>
* Lorenzo Battistini <[email protected]>
* Julien Coux <[email protected]>
* Jairo Llopis <[email protected]>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This contribution is very little to include you here. In fact, it's a patch.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, but it's mine 😊

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

git blame will know that, but here we put only relevant contributors, or the list would be big for all the modules.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems important to me. 😛


Much of the work in this module was done at a sprint in Sorrento, Italy in
April 2016.
Expand Down
9 changes: 6 additions & 3 deletions account_financial_report_qweb/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
'name': 'QWeb Financial Reports',
'version': '9.0.1.0.0',
'version': '9.0.1.0.1',
'category': 'Reporting',
'summary': 'OCA Financial Reports',
'author': 'Camptocamp SA,'
Expand Down Expand Up @@ -35,8 +35,11 @@
'report/templates/trial_balance.xml',
'view/account_view.xml'
],
'test': [
],
'external_dependencies': {
"python": [
"xlsxwriter",
],
},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAICS xslxwriter is not a direct dependency of afr_qweb. It is a dependency of report_xslx, so it should not be declared here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the patch and put the try lower in the stack. Please review that, you probably missed that.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yajo indeed I had not seen that part

IMO it is not the best way to do it because this override of create_xlsx_report does not call super(). @jcoux I think reporting-engine must be extended to support options.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And it should be split in 2 modules: one for the QWeb part, and the other for XLSX support extension.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's the job for another PR. 😄

'installable': True,
'application': True,
'auto_install': False,
Expand Down
9 changes: 8 additions & 1 deletion account_financial_report_qweb/report/abstract_report_xlsx.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,16 @@
# Author: Julien Coux
# Copyright 2016 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
try:
import xlsxwriter
except ImportError: # pragma: no cover
import logging
_logger = logging.getLogger(__name__)
_logger.info("Missing dependency: xlsxwriter.")
_logger.debug("ImportError details:", exc_info=True)

from cStringIO import StringIO
import xlsxwriter

from openerp.addons.report_xlsx.report.report_xlsx import ReportXlsx


Expand Down