Skip to Content
Menu
This question has been flagged
1 Reply
785 Views

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
Discard
Author 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
Discard
Related Posts Replies Views Activity
1
Dec 18
5184
0
Jun 21
6368
1
Nov 22
5639
1
Oct 21
3300
2
Nov 18
10206