Repository navigation
[20.0][MIG] report_qweb_parameter: Migration to 20.0 - #1231
Conversation
If reusing existing records, there's the risk of conflicting tests, like modifying the VAT for the existing company and that company having a country with VAT check. We avoid it creating a new company instead.
…@T-raw WARNING devel odoo.addons.base.models.ir_qweb: Found deprecated directive @T-raw='docs.env["ir.qweb"].check_length(docs[0].vat, 10, False)[:10]' in template 237. Replace by @t-out, and explicitely wrap content in `Markup` if necessary (which likely is not the case) WARNING devel odoo.addons.base.models.ir_qweb: Found deprecated directive @T-raw='docs.env["ir.qweb"].check_length(docs[0].company_registry, False, 10)' in template 237. Replace by @t-out, and explicitely wrap content in `Markup` if necessary (which likely is not the case)
Execute pre-commit to remove the existing warning. WARNING prod py.warnings: /opt/odoo/custom/src/odoo/odoo/addons/base/models/ir_module.py:178: DeprecationWarning: XML declarations in HTML module descriptions are deprecated since Odoo 17, report_qweb_parameter can just have a UTF8 description with not need for a declaration.
|
The following commit authors need to sign the Contributor License Agreement: |
adasatorres-tecnativa
left a comment
There was a problem hiding this comment.
LGTM. Please, squash the administrative commits.
carlos-lopez-tecnativa
left a comment
There was a problem hiding this comment.
Code review: LGTM, just one minor change in the test. If you can apply it, that would be great.
| <li id="esc_length" | ||
| t-minlength="10" | ||
| t-length="10" | ||
| t-out="docs[0].street" | ||
| t-if="docs[0].street"/> | ||
| <li id="esc_conditional_length" | ||
| t-length="3" | ||
| t-out="docs[0].name or docs[0].phone"/> | ||
| <li id="esc_maxlength" | ||
| t-maxlength="10" | ||
| t-out="docs[0].website" | ||
| t-if="docs[0].website"/> | ||
| <li id="raw_length" | ||
| t-minlength="10" | ||
| t-length="10" | ||
| t-out="docs[0].vat" | ||
| t-if="docs[0].vat"/> | ||
| <li id="raw_conditional_length" | ||
| t-length="4" | ||
| t-out="docs[0].name or docs[0].phone"/> | ||
| <li id="raw_maxlength" | ||
| t-maxlength="10" | ||
| t-out="docs[0].phone" | ||
| t-if="docs[0].phone"/> |
There was a problem hiding this comment.
I think this data is duplicated and unnecessary. It made sense before, because you were testing t-raw and t-esc, but now only t-out is tested.
There was a problem hiding this comment.
Done, the test keeps only the t-out items and their checks. The administrative commits are squashed too, as @adasatorres-tecnativa asked.
Server QWeb no longer has the t-esc and t-raw directives in 20.0 (only t-out is compiled), so the overrides of _compile_directive_esc and _compile_directive_raw are dropped; t-length, t-minlength and t-maxlength keep working on t-out, which is the only public contract of the module. Tests: the test template keeps only its t-out items, since the t-esc and t-raw ones would now repeat them, and res.company has no company_registry field in 20.0, so it uses phone instead; the test still renders the report and checks truncation and both length validations.
03db641 to
cfeb6bb
Compare
|
/ocabot migration report_qweb_parameter |
|
This PR looks fantastic, let's merge it! |
|
Congratulations, your PR was merged at e7501f5. Thanks a lot for contributing to OCA. ❤️ |
@Tecnativa
ping @sergio-teruel @carlos-lopez-tecnativa @juancarlosonate-tecnativa