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' )