Manage RPCReturnException in proteus

35ed4aa50b16 introduced this new exception so proteus execute the returned
action when configured with trytond.
This commit is contained in:
Cédric Krier
2023-02-02 18:09:52 +01:00
parent 58d00ed942
commit 79768b4890
2 changed files with 6 additions and 1 deletions
+1
View File
@@ -1,3 +1,4 @@
* Manage RPCReturnException
* Run action from button
Version 6.6.0 - 2022-10-31
+5 -1
View File
@@ -181,7 +181,7 @@ class _TrytondMethod(object):
self._config = config
def __call__(self, *args, **kwargs):
from trytond.rpc import RPC
from trytond.rpc import RPC, RPCReturnException
from trytond.tools import is_instance_method
from trytond.transaction import Transaction, TransactionError
from trytond.worker import run_task
@@ -220,6 +220,10 @@ class _TrytondMethod(object):
transaction.rollback()
e.fix(extras)
continue
except RPCReturnException as e:
transaction.rollback()
transaction.tasks.clear()
result = e.result()
transaction.commit()
break
while transaction.tasks: