After many things tried, I've still a problem.
I'm developping a custom loyalty coupon module and I want to print them.
I've got a popup view with a preview of a coupon that seems like this :
In this picture, the print button is in a file called "views.xml" and the code is :
<button string="Print" icon="gtk-print" type="object" name="%(action_report_coupon)d" class="oe_highlight"/>
In the same class, I've created a declaration for my report as this :
loyalty, here, is the name of the python file loyalty.py (the model class for my module) which contains the class loyalty.coupon.
In another file, called by the report above, there is my template for the pdf that will be print by clicking the previous button. Its name is "report.xml" and its code is :
<?xml version="1.0" encoding="utf-8"?>
<t t-foreach="docs" t-as="o">
<t t-call="loyalty.report_coupon_document" t-lang="o.lang"/>
But, it's still not working. I don't understand where the problem is, even if it's possible to read an error message when clicking on the button that is :
AttributeError: 'loyalty.coupon' object has no attribute '354'
Please, help me. The lack of information about this is a big problem for me, that is a beginner with Odoo.
Thank you so much in advance !
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
About This Community
|Asked: 6/14/16, 4:40 AM|
|Seen: 334 times|
|Last updated: 6/15/16, 10:13 AM|