İçereği Atla
Menü
Bu soru işaretlendi
2 Cevaplar
7339 Görünümler

 workorder_count = fields.Integer('# Work Orders', compute='_compute_workorder_count')

"workorder+=1"  it doesn't work

Avatar
Vazgeç

Can You Explain Your Question in Brief?

En İyi Yanıt

Hi,

workorder_count = fields.Integer('# Work Orders', compute='_compute_workorder_count')

The above line is field declaration and if you have to increment the value on the field workorder_count, write a function in the name you have mentioned in the compute "_compute_workorder_count".

@api.depends('workorder_count')
def _compute_workorder_count(self):
     self.workorder_count += 1


Thanks

Avatar
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
0
Ağu 22
2363
1
Tem 22
20050
0
Nis 22
3032
3
Eyl 21
3187
2
Eyl 21
4481