Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
How to make thirdmodel.field related to one2many secondmodel.field
fieldone = fields.Many2one('second', 'Nom', required=False)
fieldsecond= fields.One2many('one', 'fieldone', string="___", required=False)
fieldthird = fields.One2many( comodel_name='one', store=True, related='field2third.fieldsecond')
field2third=fields.Many2one('second', string='___', required=False)
i try this structure many time:
field = target._fields[name]
Here is the example of the One2many field.
journal_id = fields.One2many('account.journal', 'bank_account_id', domain=[('type', '=', 'bank')], string='Account Journal', readonly=True)
An One2many field is a recordset so for access use self.onetomanyfield.name but not a target._fields[name].
About This Community
This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 10/16/16, 9:24 AM|
|Seen: 832 times|
|Last updated: 10/16/16, 3:45 PM|