跳至内容
菜单
此问题已终结
1 回复
754 查看

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?

形象
丢弃
编写者 最佳答案

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')
形象
丢弃
相关帖文 回复 查看 活动
1
12月 18
5166
0
6月 21
6353
1
11月 22
5604
1
10月 21
3286
2
11月 18
10194