Hello,
I'm currently creating an Odoo 9 module and I've got this view :
http://i.imgur.com/FK6GhFO.png
When you click on the print button, I've got this error :
File "/opt/odoo/openerp/addons/base/ir/ir_model.py", line 972, in xmlid_lookup raise ValueError('External ID not found in the system: %s' % (xmlid)) ValueError: External ID not found in the system: coupon.report_invoice
My code is composed by two things :
-> A report :
<report id="report_coupon" model="report.coupon" string="Coupons" report_type="qweb-pdf" name="coupon.report_invoice" file="coupon.report_invoice" attachment_use="True" attachment="(object.state in ('open','paid')) and ('INV'+(object.number or '').replace('/','')+'.pdf')" /> |
-> A python class :
class CouponReport(models.Model): _name = 'report.coupon' def render_html(self, cr, uid, ids, data=None, context=None): report_obj = self.pool['report'] report = report_obj._get_report_from_name( cr, uid, 'coupon' ) docargs = { 'doc_ids': ids, 'doc_model': report.model, 'docs': self.pool[report.model].browse( cr, uid, ids, context=context ), } return report_obj.render( cr, uid, ids, 'coupon', docargs, context=context ) |
I don't understand what is wrong with my code.
Please, help me !
Thanks in advance for you help.