I have noticed that if i make a odoo json rpc call, im doing it with postman, to a function called my_function that does the following
def my_function(self, values):
mess = "Success"
try:
holder = self.prepare_values(values)
#This perform an operations that sometimes result in an exception, because the sended values are wrong
#for example, if the function first create record in a model example.example, and then raises an exception
#the created record still remains after throwing the exception and returning the answer
self.do_something(holder)
except Exception as err:
mess = "Something went wrong"
return mess
Is this the normal behavior? In my experience even if I catch the exception the changes made by the function that throw the exception should not remain. If this is the normal behavior, what can I do to revert or prevent saving the changes made by the function that gave exception?
Pertanyaan ini telah diberikan tanda
5233
Tampilan
Menikmati diskusi? Jangan hanya membaca, ikuti!
Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!
Daftar| Post Terkait | Replies | Tampilan | Aktivitas | |
|---|---|---|---|---|
|
|
1
Jul 25
|
10458 | ||
|
|
0
Mar 21
|
5559 | ||
|
|
1
Feb 26
|
6654 | ||
|
how to output json from char field to html?
Diselesaikan
|
|
2
Agu 23
|
5465 | |
|
|
1
Sep 20
|
8480 |
I'm having a similar behavior, did you found any solution ?