Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
14236 Visualizzazioni

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')
Avatar
Abbandona
Risposta migliore

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

Avatar
Abbandona
Autore

Thx this worked

Post correlati Risposte Visualizzazioni Attività
2
mar 24
1783
1
dic 19
4956
2
nov 19
6645
0
lug 19
4240
1
dic 18
3901