Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2006 Zobrazení

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
1
úno 18
3428
1
úno 16
3594
1
bře 15
4255
1
bře 15
4903
1
lis 23
2425