when i use store= True the integer score get value 0 and when i don't use it it's okay
this is the declaration of field score
score = fields.Integer(string="score", readonly=True, compute="_onchange_calcul_score")
and this is the fonction
@api.onchange('response_id')
def _onchange_calcul_score(self):
for rec in self:
if rec.response_id:
rec.score = rec.response_id.quizz_score
The reason that value is 0 once stored in the database is because the value hasn't been updated.
When store=False, the value is calculated on the fly. To prompt the calculated field to update you need to update the onchange/depends field. So when you change response_id the field should change if everything has been done correctly.
I would suggest exporting and importing using CSV/Excel, if you change onchange to depends, this should work.
Thanks,
thank you Jack Dane