Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
14414 Widoki

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')
Awatar
Odrzuć
Najlepsza odpowiedź

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

Awatar
Odrzuć
Autor

Thx this worked

Powiązane posty Odpowiedzi Widoki Czynność
2
mar 24
1967
1
gru 19
5102
2
lis 19
6900
0
lip 19
4435
1
gru 18
4048