Skip to Content
Menu
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
Discard
Related Posts Replies Views Activity
1
Feb 18
2297
1
Feb 16
2509
1
Mar 15
3160
1
Mar 15
3459
1
Nov 23
1113