[FIX] view_form: use the reference of menu from the instance, not from the widget...
authorSimon Lejeune <sle@openerp.com>
Fri, 11 Jul 2014 09:51:54 +0000 (11:51 +0200)
committerSimon Lejeune <sle@openerp.com>
Fri, 11 Jul 2014 09:51:54 +0000 (11:51 +0200)
Fixes #1024: when using a formview on a non trivial way, the reference of the menu using the widget ancestors may be wrong

addons/web/static/src/js/view_form.js

index e3b8e3e..5767ffe 100644 (file)
@@ -701,9 +701,9 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
             self.trigger("save", result);
             self.reload().then(function() {
                 self.to_view_mode();
-                var parent = self.ViewManager.ActionManager.getParent();
-                if(parent){
-                    parent.menu.do_reload_needaction();
+                var menu = instance.webclient.menu;
+                if (menu) {
+                    menu.do_reload_needaction();
                 }
             });
         }).always(function(){