Skip to Content
Menu
This question has been flagged
2 Replies
7352 Rodiniai

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

"workorder+=1"  it doesn't work

Portretas
Atmesti

Can You Explain Your Question in Brief?

Best Answer

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

Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
0
rugp. 22
2364
1
liep. 22
20057
0
bal. 22
3035
3
rugs. 21
3190
2
rugs. 21
4482