Cédric Krier pushed to branch branch/default at Tryton / Tryton


Commits:
d671b844 by Cédric Krier at 2023-02-02T18:09:52+01:00
Manage RPCReturnException in proteus

35ed4aa50b16 introduced this new exception so proteus execute the returned
action when configured with trytond.
- - - - -


2 changed files:

- proteus/CHANGELOG
- proteus/proteus/config.py


Changes:

=====================================
proteus/CHANGELOG
=====================================
@@ -1,3 +1,4 @@
+* Manage RPCReturnException
 * Run action from button
 
 Version 6.6.0 - 2022-10-31


=====================================
proteus/proteus/config.py
=====================================
@@ -181,7 +181,7 @@
         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 @@
                     transaction.rollback()
                     e.fix(extras)
                     continue
+                except RPCReturnException as e:
+                    transaction.rollback()
+                    transaction.tasks.clear()
+                    result = e.result()
                 transaction.commit()
             break
         while transaction.tasks:



View it on Heptapod: 
https://foss.heptapod.net/tryton/tryton/-/commit/d671b8445830ea2dbf59e18ccf1f1137abe79d0e

-- 
View it on Heptapod: 
https://foss.heptapod.net/tryton/tryton/-/commit/d671b8445830ea2dbf59e18ccf1f1137abe79d0e
You're receiving this email because of your account on foss.heptapod.net.


Reply via email to