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

When I try to update a field before raising a UserError, the value doesn't get saved to the database. How can I ensure the field is saved even before the UserError is raised?

Avatar
Descartar
Autor Mejor respuesta

We can use 

self.env.cr.commit()

just before the UserError() to save the values.

Eg:

self.env.cr.commit()
raise UserError('Some issue has been occured')
Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
1
dic 18
5176
0
jun 21
6358
1
nov 22
5613
1
oct 21
3289
2
nov 18
10198