跳至內容
選單
此問題已被標幟
2043 瀏覽次數

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)




頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
2月 18
3444
1
2月 16
3603
1
3月 15
4260
1
3月 15
4937
1
11月 23
2432