Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
769 Visualizzazioni

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
Abbandona
Autore Risposta migliore

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
Abbandona
Post correlati Risposte Visualizzazioni Attività
1
dic 18
5177
0
giu 21
6362
1
nov 22
5621
1
ott 21
3293
2
nov 18
10203