Ir al contenido
Menú
Se marcó esta pregunta
2 Respuestas
7355 Vistas

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

"workorder+=1"  it doesn't work

Avatar
Descartar

Can You Explain Your Question in Brief?

Mejor respuesta

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
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
0
ago 22
2364
1
jul 22
20057
0
abr 22
3038
3
sept 21
3190
2
sept 21
4484