-
-
Notifications
You must be signed in to change notification settings - Fork 774
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
[11.0][IMP] report_xlsx, make sure print_report_name works #327
[11.0][IMP] report_xlsx, make sure print_report_name works #327
Conversation
94dd6ad
to
ec6adb0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's working, but could fail in special cases, look inline comment.
Please, patch the v12 with this too. Sorry for not seeing before.
Thank you!
report_xlsx/controllers/main.py
Outdated
@@ -29,13 +31,18 @@ def report_routes(self, reportname, docids=None, converter=None, **data): | |||
xlsx = report.with_context(context).render_xlsx( | |||
docids, data=data | |||
)[0] | |||
report_name = report.report_file | |||
if report.print_report_name and not len(docids) > 1: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here you should check that docids is set:
if report.print_report_name and docids and not len(docids) > 1:
Just realized that sometimes a report is launched without docids, and it will fail.
In that case is fair to not personalize the name because a main object is not given and the data property would contain the details for rendering the report.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for noticing. I fixed per your request here and also in v12
ec6adb0
to
9549996
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now is safe and working correctly.
Thank you!
/ocabot merge patch |
Is this needed for 12.0? |
Hey, thanks for contributing! Proceeding to merge this for you. |
It seems that in v12 is already: |
@pedrobaeza |
Ok, thanks for confirming |
Congratulations, your PR was merged at 42bb138. Thanks a lot for contributing to OCA. ❤️ |
@jffernandez would you help test again? :)