Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
3224 Vistas

I want to write a python code for automated action,

In my task, there are certain stages 

See the above image,

There is a radio field called Ready for Implementation? 

if the user clicks Yes, if should automatically change the stage to READY FOR IMPLEMENTATION, 

If they clicks No, I have remarks, It should automatically change the stage to Remarks before Implementation


For this purpose I have given an automated action

But I am not sure the python code is correct


Avatar
Descartar
Mejor respuesta

Hi,

Try this:

def _onchange_ready_for_implementation(self):
if self.ready_for_implementation == 'yes':
self.stage = 'ready'
elif self.ready_for_implementation == 'no':
self.stage = 'remarks'
 
@api.onchange('remarks')
def _onchange_remarks(self):
if self.remarks:
self.stage = 'remarks'

Regards

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
0
ene 23
1567
0
jul 22
1817
1
jun 23
3303
1
may 23
1902
0
abr 23
1703