Manage RPCReturnException in proteus
35ed4aa50b16 introduced this new exception so proteus execute the returned action when configured with trytond.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
* Manage RPCReturnException
|
||||
* Run action from button
|
||||
|
||||
Version 6.6.0 - 2022-10-31
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user