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.
I have a model in which i want that a field of one Entity depends on a field of another entity. Entities are bound with one2many/many2one relationship. I tried the following code but without success
I tried to follow official documentation example here: https://www.odoo.com/documentation/11.0/howtos/backend.html#dependencies but since code isn't complete I have difficulty in guessing variables
I also found some examples with @api.one and @api.multi and I would like to know the difference with @api.depends
_name = 'modulotest01.cantiere'
name = fields.Char(required=True)
description = fields.Text()
magazzino = fields.One2many('modulotest01.magazzino', 'cantiere')
magazzinopieno = fields.Boolean(compute="_capacityMagazzino", store=True)
if self.capacitaLotti > 24:
magazzinopieno = True
_name = 'modulotest01.magazzino'
capacitaLotti = fields.Integer()
cantiere = fields.Many2one('modulotest01.cantiere', string='Cantiere', index=True, ondelete='cascade' )
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: 4/15/18, 5:50 AM|
|Seen: 147 times|
|Last updated: 4/16/18, 10:39 AM|