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?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- Müşteri İlişkileri Yönetimi
- e-Commerce
- Muhasebe
- Envanter
- PoS
- Project
- MRP
Bu soru işaretlendi
4064
Görünümler
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Üye Ol| İlgili Gönderiler | Cevaplar | Görünümler | Aktivite | |
|---|---|---|---|---|
|
|
1
Tem 25
|
9056 | ||
|
|
0
Mar 21
|
4762 | ||
|
|
2
Ağu 23
|
4167 | ||
|
|
1
Eyl 20
|
7054 | ||
|
|
6
Tem 20
|
12715 |
I'm having a similar behavior, did you found any solution ?