Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
775 Weergaven

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
Annuleer
Auteur Beste antwoord

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
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
1
dec. 18
5181
0
jun. 21
6365
1
nov. 22
5634
1
okt. 21
3299
2
nov. 18
10203