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] product_print_category: use key instead of xml_id #149

Open
wants to merge 1 commit into
base: 12.0
Choose a base branch
from

Conversation

remytms
Copy link
Contributor

@remytms remytms commented Oct 6, 2022

Use the key instead of the xml_id to find qweb template for the pricetag. This let user create their own template via the Odoo interface, because such template does not have xml_id.

Step to reproduce:

  1. Create a new qweb template in Odoo via the menu Settings > Technical > User Interface > View. And put xml content to print a customised pricetag.
  2. Create a product.print.category and refer to the previously created qweb template.

Intended behaviour:
Pricetag can be generated using the new qweb template

Occurring:
Error when generating template saying that template '' is not found.

Issue:
The problem comes from the fact that qweb template created in the Odoo interface has no xml_id as they do not comes from a file in a module.

Fix:
Using the field key instead of the field xml_id fix this.

coopiteasy task

@codecov
Copy link

codecov bot commented Oct 6, 2022

Codecov Report

Merging #149 (6324381) into 12.0 (e4bb846) will increase coverage by 0.21%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##             12.0     #149      +/-   ##
==========================================
+ Coverage   78.62%   78.84%   +0.21%     
==========================================
  Files         141      142       +1     
  Lines        2255     2278      +23     
  Branches      362      364       +2     
==========================================
+ Hits         1773     1796      +23     
  Misses        430      430              
  Partials       52       52              
Impacted Files Coverage Δ
product_print_category/models/__init__.py 100.00% <0.00%> (ø)
product_print_category/models/product_product.py 100.00% <0.00%> (ø)
product_print_category/models/product_template.py 100.00% <0.00%> (ø)
...rint_category/tests/test_product_print_category.py 100.00% <0.00%> (ø)
...nt_category/models/product_print_category_mixin.py 100.00% <0.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@remytms
Copy link
Contributor Author

remytms commented Oct 10, 2022

@legalsylvain If we can get in touch about that during OCA Days. :)

@remytms
Copy link
Contributor Author

remytms commented Oct 24, 2022

@legalsylvain I've tested this modification:

✔️ local, with demo data.
✔️ test server, with other modules installed.

This is the PDF generated by the demo data: Pricetags.pdf

@remytms
Copy link
Contributor Author

remytms commented Dec 15, 2022

@legalsylvain Can it be merge ? :)

@remytms
Copy link
Contributor Author

remytms commented Jul 12, 2023

@legalsylvain up on that. :)

@remytms
Copy link
Contributor Author

remytms commented Jul 12, 2023

@legalsylvain Sorry I found that it was part of the migration on 16.0 here: OCA/product-attribute#1176

So it's ok to me to leave the PR open and not merged. It's in production on our server. :)

@legalsylvain
Copy link
Member

So it's ok to me to leave the PR open and not merged. It's in production on our server. :)

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants