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
|
7060 | |||
|
0
6월 21
|
8128 | |||
|
1
11월 22
|
10150 | |||
|
1
10월 21
|
5815 | |||
|
2
11월 18
|
13024 |
1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.