How to access a field of another model?
I have a field in account.invoice
_inherit = 'account.invoice'
company_selection = fields.Many2one('account.analytic.account', string="Company")
I want to access the value of the field company_selection in another model so i did it using a related field like below.
_inherit = "account.move"
rel_account_invoice = fields.Many2one('account.invoice', string='Related Account Invoice')
rel_company_selection = fields.Many2one(related='rel_account_invoice.company_selection')
but when i check the value in rel_company_selection it gives me none i.e., account.analytic.account()
How to access the value of company_selection in account.move model?