跳至內容
選單
此問題已被標幟
1 回覆
761 瀏覽次數

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
5176
0
6月 21
6359
1
11月 22
5614
1
10月 21
3289
2
11月 18
10198