[FIX] pager: do not try to toggle the visibility if the pager do not exists yet
authorMartin Trigaux <mat@openerp.com>
Fri, 14 Mar 2014 11:27:09 +0000 (12:27 +0100)
committerMartin Trigaux <mat@openerp.com>
Fri, 14 Mar 2014 11:27:09 +0000 (12:27 +0100)
bzr revid: mat@openerp.com-20140314112709-0sqq6tcpmza34q1e

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

index f1b30f6..cd220ca 100644 (file)
@@ -271,12 +271,14 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
         if (this.$buttons) {
             this.$buttons.show();
         }
+        if (this.$pager) {
+            this.$pager.toggle(this.dataset.ids.length > 1);
+        }
         this.$el.show().css({
             opacity: '0',
             filter: 'alpha(opacity = 0)'
         });
         this.$el.add(this.$buttons).removeClass('oe_form_dirty');
-        this.$pager.toggle(this.dataset.ids.length > 1);
 
         var shown = this.has_been_loaded;
         if (options.reload !== false) {