[FIX] view switcher for dashboard creatable record.
authorVaibhav (OpenERP) <vda@tinyerp.com>
Thu, 5 Jan 2012 08:19:16 +0000 (13:49 +0530)
committerVaibhav (OpenERP) <vda@tinyerp.com>
Thu, 5 Jan 2012 08:19:16 +0000 (13:49 +0530)
lp bug: https://launchpad.net/bugs/908719 fixed

bzr revid: vda@tinyerp.com-20120105081916-dhlaaro01zc0995x

addons/web/static/src/js/views.js

index 6a70be5..3715b3f 100644 (file)
@@ -359,6 +359,10 @@ session.web.ViewManager =  session.web.Widget.extend(/** @lends session.web.View
         // after saving, go to page view (don't come back in list)"
         if (created && current_view === 'form' && previous_view === 'list') {
             return this.on_mode_switch('page');
+        } else if(created && this.action && this.action.flags.default_view == 'form') {
+            //Special case: dashboad creatable attrs,
+            // no previous view for creatable action.
+            return this.on_mode_switch('page');
         }
         return this.on_mode_switch(previous_view, true);
     },