Skip to Content
मेन्यू
This question has been flagged
1 Reply
753 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
दिस॰ 18
5166
0
जून 21
6353
1
नव॰ 22
5604
1
अक्तू॰ 21
3286
2
नव॰ 18
10194