Skip to Content
Menu
This question has been flagged
1 Atsakyti
782 Rodiniai

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?

Portretas
Atmesti
Autorius Best Answer

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')
Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
1
gruod. 18
5182
0
birž. 21
6367
1
lapkr. 22
5635
1
spal. 21
3299
2
lapkr. 18
10204