Hi there,
i try to get a relation between account_invoice and sales_order to show a custom field of sales_order in my invoice report. Therefore i inherit account.invoice with a sales_order_id field.
# -*- coding: utf-8 -*-
from odoo import models, fields, api
class account_invoice(models.Model):
_inherit = "account.invoice" sale_order_id = fields.Many2one('sale.order', string='Related Order')
I want to access the value of the custom field ( e.g. tm_short_description ) in the invoice report ( o.sale_order_id.tm_short_description )
The problem is, creating a new invoice, the account_invoice.sales_order_id will not be filled. Updating it manually the report is ok. Do i have to override some default original function to get the sales_order_id to account.invoice ?
Thanks for your help,
Franz