コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
766 ビュー

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
5177
0
6月 21
6362
1
11月 22
5619
1
10月 21
3290
2
11月 18
10199