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?
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
|
7067 | |||
|
0
6月 21
|
8131 | |||
|
1
11月 22
|
10154 | |||
|
1
10月 21
|
5821 | |||
|
2
11月 18
|
13024 |
1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.