Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
7335 Visualizzazioni

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

"workorder+=1"  it doesn't work

Avatar
Abbandona

Can You Explain Your Question in Brief?

Risposta migliore

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
Abbandona
Post correlati Risposte Visualizzazioni Attività
0
ago 22
2357
1
lug 22
20046
0
apr 22
3014
3
set 21
3182
2
set 21
4477