[FIX] web: force load record after reload page
authorMartin Trigaux <mat@openerp.com>
Fri, 3 Oct 2014 07:29:07 +0000 (09:29 +0200)
committerMartin Trigaux <mat@openerp.com>
Fri, 3 Oct 2014 07:29:22 +0000 (09:29 +0200)
When reloading a page, the _actualize_mode is called before the record is loaded and the form is displayed partially in edit mode (o2m fields with delete/add icons).
This patch forces to trigger a load_record when the datarecord has not been loaded yet in the do_show merthod (opw 607910)

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

index ee15592..3e5d386 100644 (file)
@@ -282,7 +282,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
         this.$el.add(this.$buttons).removeClass('oe_form_dirty');
 
         var shown = this.has_been_loaded;
-        if (options.reload !== false) {
+        if (options.reload !== false || !this.datarecord.id) {
             shown = shown.then(function() {
                 if (self.dataset.index === null) {
                     // null index means we should start a new record