Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
13549 มุมมอง

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

Related Posts ตอบกลับ มุมมอง กิจกรรม
2
มี.ค. 24
1291
1
ธ.ค. 19
4649
2
พ.ย. 19
6100
0
ก.ค. 19
3838
1
ธ.ค. 18
3564