Hello,
I'm currently creating an Odoo 9 module and I've got a Class with a report_coupon function called by a button.
Here is my class :
class loyalty_coupon(models.Model): _name = 'loyalty.coupon' _columns = { 'name': fields.char('Name', size=32, select=1, required=True, help='An internal identification for this loyalty coupon'), 'loyalty_program_id': fields.many2one('loyalty.program', 'Loyalty Program', help='The Loyalty Program this coupon belongs to'), 'reduction': fields.float('Reduction', help='The amount of reduction of this coupon in EUR'), 'date': fields.date('Date Limit', help='The date limit of the coupon'), 'limited': fields.boolean('Limited', help='The kind of coupon'), 'used': fields.boolean('Used', help='The state of the coupon, used or not used'), 'barcode': fields.char('Barcode', help="International Article Number used for coupon identification.", oldname='ean13', copy=False), }
@api.one def report_coupon(self): _logger.info("IMPRESS") |
I want this function to allow the user to download a pdf file generated (composed of attributes of the class).
How can I do this ? :)
Thank you in advance for your replies and help !