跳至內容
選單
此問題已被標幟
1 回覆
14400 瀏覽次數

Im trying to divide a value of my Integer field by a static value which is an int, of course this wont work, what is the solution to this ?

@api.one
def _compute_uren(self):
treatment_duur = fields.Integer(related='treatment_id.duur')
self.uren = treatment_duur // 60

uren = fields.Integer(compute='_compute_uren')
頭像
捨棄
最佳答案

treatment_duur = fields.Integer(related='treatment_id.duur')

uren = fields.Integer(compute='_compute_uren')


@api.one

def _compute_uren(self):

        self.uren = self.treatment_duur // 60

頭像
捨棄
作者

Thx this worked

相關帖文 回覆 瀏覽次數 活動
2
3月 24
1963
1
12月 19
5095
2
11月 19
6882
0
7月 19
4424
1
12月 18
4045