Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
1018 Tampilan

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?

Avatar
Buang
Penulis Jawaban Terbai

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')
Avatar
Buang
Post Terkait Replies Tampilan Aktivitas
1
Des 18
5389
0
Jun 21
6630
1
Nov 22
6290
1
Okt 21
3600
2
Nov 18
10440