Community mailing list archives

Re: related field in odoo v8

Paul Catinean
- 09/05/2014 05:21:52

You can use the in the standard addons as reference as it is the first module migrated to the new API

You fill find examples there concerning your problem:

partner_id = fields.Many2one('res.partner', string='Partner',
        related='invoice_id.partner_id', store=True, readonly=True)

In your case it would be something like:
'company_id': fields.Many2one('', string="Company', 
        related="invoice_id.company_id', store=True, readonly=True)

Also I think it would be a better idea to refer to for questions instead of the community list

A few resources regarding the new api:


On Fri, Sep 5, 2014 at 12:05 PM, abhishek jaiswal <> wrote:
how can i use fields.related in Odoo V8

i am perting a module and i got stucked with field.related

hoe to change this
'company_id': fields.related('invoice_id','company_id',type='many2one',relation='',string='Company', store=True, readonly=True),

into new api
With Warm Regards
Abhishek Jaiswal

Post to: