Hi
I have those two classes
First
class my_participation(models.Model):
_name = "participation.participation"
_name = "participation.participation"
_description = "participation"
_rec_name="participation_num"
solde = fields.Integer(string="Solde")
fidelite = fields.Many2one("fidelite.fidelite", "Fidelite ", ondelete="cascade", required="true")
Seconde
class my_fidelite(models.Model):
_name = "fidelite.fidelite"
_description = "fidelite"
_rec_name="fidelite_num"
fidelite_num = fields.Char(string='Code de fidelite', required="true")
_sql_constraints = [ ('fidelite_c_unique', 'unique (fidelite_num)', 'Ce code EXIST ')]
participation_ids = fields.One2many("participation.participation", "fidelite", "Participations concernees")
sum_participations_solde = fields.Integer(string='Solde of fidelite')
my question is how can i calculate sum_participations_solde that presents the sum of all soldes of participations that correspond to this fidelite ?
THANK YOU