コンテンツへスキップ
メニュー
この質問にフラグが付けられました

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
3422
1
2月 16
3591
1
3月 15
4246
1
3月 15
4896
1
11月 23
2420