Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
756 Widoki

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?

Awatar
Odrzuć
Autor Najlepsza odpowiedź

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')
Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
gru 18
5168
0
cze 21
6356
1
lis 22
5605
1
paź 21
3286
2
lis 18
10194