Skip to Content
Menu
This question has been flagged
1 Odpoveď
768 Zobrazenia

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
Zrušiť
Autor Best Answer

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
Zrušiť
Related Posts Replies Zobrazenia Aktivita
1
dec 18
5177
0
jún 21
6362
1
nov 22
5619
1
okt 21
3293
2
nov 18
10202