Conversation
Replace README.md by README.rst (not finished)
Remove <data> in views Protect import of py3o libs Remove dep on base module Other small changes
Rename __openerp__.py to __manifest__.py
lang_code is already supported by o_format_date
Co-Authored-By: lmignon <laurent.mignon@acsone.eu>
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: reporting-engine-12.0/reporting-engine-12.0-report_py3o Translate-URL: https://translation.odoo-community.org/projects/reporting-engine-12-0/reporting-engine-12-0-report_py3o/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: reporting-engine-12.0/reporting-engine-12.0-report_py3o_fusion_server Translate-URL: https://translation.odoo-community.org/projects/reporting-engine-12-0/reporting-engine-12-0-report_py3o_fusion_server/
|
@tbaden Thank you for taking care of this backport. Can I ask you to preserve the commit history and authorship of changes when backporting the addons from Odoo 12.
(same method as for normal migration process but adapted to takes the 12.0 branch as source. This method also takes care to migrate report_py3o and report_py3o_fusion_server at same time. https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-12.0#technical-method-to-migrate-a-module-from-110-to-120-branch) |
|
@lmignon I'll take care of this. |
Thank you to you for this work 😏 |
|
@lmignon maybe you can give me a hint. I got all tests on green now except for test_reports_merge_zip. getting the error: TypeError: argument should be a bytes-like object or ASCII string, not 'bool' If you need it, I can push my current code to github. |
|
Hey @tbaden, thank you for your Pull Request. It looks like some users haven't signed our Contributor License Agreement, yet.
Appreciation of efforts, |
|
tbaden
left a comment
There was a problem hiding this comment.
When I checked the object neither of the entries had images and only the last one failed. I'll check again.
|
@lmignon @pedrobaeza locally it pass, because of libreoffice installation, but travis will fail. |
seems like I dived to deep... found it and catching this issue in the context parser. on local all tests are green |
|
| report_xml._get_rendering_context(model_instance.ids, data) | ||
| ) | ||
| context['objects'] = model_instance | ||
| # image false will crash base64 decoding |
There was a problem hiding this comment.
@tbaden The image field does not exist on all models. It is in the template that you must add an `if' instruction before using this field (it is a demo template)
There was a problem hiding this comment.
how would this instruction look like in the odt template?
additional: wouldn't it be good to still check if image exists in objects and when false to set it to empty bytestring. otherwise you'll get an error if an user forgets this if instruction.
like this:
if (
hasattr(context['objects'], 'image') and
not context['objects'].image
):
context['objects'].image = b''
There was a problem hiding this comment.
@tbaden A report can be defined for any model and the name of a field used to store an image is not always 'image'.
It's important to manage this case into the template to also avoid to display an empty square if the image is missing into the document.
You can use a control structure into the template to avoid to output an image if not set https://py3otemplate.readthedocs.io/en/latest/templating.html#use-control-structures
There was a problem hiding this comment.
@tbaden The demo template seems to no more work....
There was a problem hiding this comment.
@lmignon the use of simplejson could fix this. what's your opinion on this?
like:
try:
import simplejson as json
except ImportError:
import json
There was a problem hiding this comment.
@tbaden Before introducing a new dependency I prefer to understand what's the root cause of the problem...
There was a problem hiding this comment.
I'll reset my dev env and install it again. Maybe I messed it up somewhere for other developments.
There was a problem hiding this comment.
I think we should try to stay with the standard python libraries. It doesn't seem normal to me that the result of serialization to json works with one library and not another when it shouldn't make any difference. I have the feeling that the problem encountered is elsewhere.
There was a problem hiding this comment.
@lmignon I found the "issue". In v11 the portal User has no image, in v12 the portal user has an image. If you delete the image in v12 you get the exact same error:
File "/usr/lib/python3.5/base64.py", line 46, in _bytes_from_decode_data
"string, not %r" % s.class.name) from None
TypeError: argument should be a bytes-like object or ASCII string, not 'bool'
If I use my if structure template I get the same error:
E TypeError: b'iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVQI12P4//8/AAX+Av7czFnnAAAAAElFTkSuQmCC' is not JSON serializable
So it's a general issue in v11 and v12. As you said, this should be caught in the odt template with an if structure. Maybe my if structure is still faulty. Could you please check my odt template
|
What is the current situation with the backport? I'm using odoo 11 CE and would really like to try this module. I'd be willing to help. However, I'm a noob in odoo development. |
|
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. |
No description provided.