Search code examples
fieldodoo-10relational

Odoo 10 related field


I created custom field to res.company. But in my other class, i can not call this field,

this field inherited to res.company,

company_sicilno = fields.Char(string="Sicil No :")

and this field is in my other class,

sicil_no = fields.Char(related='res.company.company_sicilno',store=True)

i could not find mistake, it does not show any error message. How can i call this res.company.company_sicilno in my other field?


Solution

  • I solved the problem

    company_id = fields.Many2one('res.company',string="Company",default=lambda self: self.env['res.company'].search([]))
    

    Thank you for your help..