Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
2 Răspunsuri
7343 Vizualizări

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

"workorder+=1"  it doesn't work

Imagine profil
Abandonează

Can You Explain Your Question in Brief?

Cel mai bun răspuns

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

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
0
aug. 22
2363
1
iul. 22
20050
0
apr. 22
3033
3
sept. 21
3188
2
sept. 21
4482