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

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

"workorder+=1"  it doesn't work

Awatar
Odrzuć

Can You Explain Your Question in Brief?

Najlepsza odpowiedź

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

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
0
sie 22
2363
1
lip 22
20050
0
kwi 22
3032
3
wrz 21
3188
2
wrz 21
4482