Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odpovědi
7376 Zobrazení

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

"workorder+=1"  it doesn't work

Avatar
Zrušit

Can You Explain Your Question in Brief?

Nejlepší odpověď

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
0
srp 22
2382
1
čvc 22
20074
0
dub 22
3056
3
zář 21
3214
2
zář 21
4506