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?
คำถามนี้ถูกตั้งค่าสถานะ
1
ตอบกลับ
2526
มุมมอง
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')
สนุกกับการพูดคุยนี้ใช่ไหม? เข้าร่วมเลย!
สร้างบัญชีวันนี้เพื่อเพลิดเพลินไปกับฟีเจอร์พิเศษและมีส่วนร่วมกับคอมมูนิตี้ที่ยอดเยี่ยมของเรา!
ลงชื่อ| Related Posts | ตอบกลับ | มุมมอง | กิจกรรม | |
|---|---|---|---|---|
|
|
1
ธ.ค. 18
|
7066 | ||
|
|
0
มิ.ย. 21
|
8129 | ||
|
|
1
พ.ย. 22
|
10153 | ||
|
|
1
ต.ค. 21
|
5821 | ||
|
|
2
พ.ย. 18
|
13024 |