changeset f70f3f848279 in sao:default
details: https://hg.tryton.org/sao?cmd=changeset;node=f70f3f848279
description:
        Clean active_* keys from context when executing an action

        As the values may be already present on the context they should be
        cleared in order to correctly evaluate action domains

        issue7839
        review68381002
diffstat:

 src/action.js |  9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diffs (27 lines):

diff -r e1ffa6204644 -r f70f3f848279 src/action.js
--- a/src/action.js     Fri Feb 15 23:07:15 2019 +0100
+++ b/src/action.js     Fri Feb 22 19:35:30 2019 +0100
@@ -8,8 +8,10 @@
     };
 
     Sao.Action.exec_action = function(action, data, context) {
-        if (context === undefined) {
+        if (!context) {
             context = {};
+        } else {
+            context = jQuery.extend({}, context);
         }
         var session = Sao.Session.current_session;
         if (data === undefined) {
@@ -17,6 +19,11 @@
         } else {
             data = jQuery.extend({}, data);
         }
+
+        delete context.active_id;
+        delete context.active_ids;
+        delete context.active_model;
+
         function add_name_suffix(name, context){
             if (!data.model || !data.ids) {
                 return jQuery.when(name);

Reply via email to