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
|
7065 | |||
|
0
6月 21
|
8129 | |||
|
1
11月 22
|
10153 | |||
|
1
10月 21
|
5819 | |||
|
2
11月 18
|
13024 |
1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.