Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
804 Представления

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?

Аватар
Отменить
Автор Лучший ответ

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
5192
0
июн. 21
6387
1
нояб. 22
5685
1
окт. 21
3314
2
нояб. 18
10227