Hello, i need help. I added job_title_2 in sale.order and want to bring job_title_2 field to account.invoice also automated field based on job_title or partner_id record. How to resolve this ?
class SaleOrder(models.Model): _inherit = 'sale.order'
job_title = fields.Char('Job Title') job_title_2 = fields.Char('Job Title 2')
class AccountInvoice(models.Model): _inherit = 'account.invoice'
job_title_2 = fields.Char('Job Title 2')
I'm overriding function but seems still not working
@api.multi def _prepare_invoice(self): res = super(SaleOrderLine, self)._prepare_invoice() res['job_title'] = self.job_title res['job_title_2'] = self.job_title_2 return res
What's wrong with my code ? thanks