hello to all - in may class, i have to set set set value of a field with the property compute, and this is what i did in my class:
class cave_casier_plein(models.Model):
_name = 'cave.casier_plein'
def calculeQte(self):
total = 0
for record in self.env['cave.approvi'].search([('idcasier', '=', self.id)]):
total += record.qte
self.qte = total # this lead to an error
qte = fields.Integer('Quantité', compute='calculeQte', store=False, readonly=True)
here i'ld like help to updte the 'qte' value of this class when the 'qte' value of class 'cave.approvi' come to change.
thanks