diff --git a/proteus/CHANGELOG b/proteus/CHANGELOG index 14e6195710..1976629b42 100644 --- a/proteus/CHANGELOG +++ b/proteus/CHANGELOG @@ -1,3 +1,4 @@ +* Manage RPCReturnException * Run action from button Version 6.6.0 - 2022-10-31 diff --git a/proteus/proteus/config.py b/proteus/proteus/config.py index 072c99f5f2..ec20ff7d76 100644 --- a/proteus/proteus/config.py +++ b/proteus/proteus/config.py @@ -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: