You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

26 lines
1021 B

from odoo import api, fields, models
class DonationTaxReceipt(models.Model):
_inherit = "donation.tax.receipt"
template_rf_id=fields.Many2one('opendons.template_rf', 'RF template')
html_content=fields.Html('html content',compute='_html_content_rf')
html_content_print=fields.Html('html content print')
def action_print_rf(self):
self.ensure_one()
html_content_print=self.html_content
html_content_print=html_content_print.replace('{{partner_id.name}}',self.partner_id.name)
html_content_print=html_content_print.replace('{{partner_id.firstname}}',self.partner_id.firstname)
self.html_content_print=html_content_print
#self.env['donation.tax_receipt'].write(vals)
#res=super(donation_tax_receipt, self).write(vals)
return self.env.ref("opendons.report_donation_tax_receipt").report_action(self)
#return True
def _html_content_rf(self):
self.html_content=self.template_rf_id.html_content