Skip to Content
Menú
This question has been flagged

I want to perform an arithmetic calculation on a field whenever the tree view gets loaded.Here here is the 

model.py:

class li(models.Model):

    ns_rate = fields.Float(compute='_compute_ns_rate', store=True)

     def _compute_ns_rate(self): 

        for record in self: 

            record.ns_rate = float(math.ceil(float(record.ns_rate)*4)/4)




Avatar
Descartar
Related Posts Respostes Vistes Activitat
1
de març 18
3623
1
de febr. 16
3780
1
de març 15
4437
1
de març 15
5276
1
de nov. 23
2696