[MERGE] [FIX] reference field: correct editable tree view for refrence field (opw...
authorMartin Trigaux <mat@openerp.com>
Wed, 15 Jan 2014 11:00:38 +0000 (12:00 +0100)
committerMartin Trigaux <mat@openerp.com>
Wed, 15 Jan 2014 11:00:38 +0000 (12:00 +0100)
bzr revid: mat@openerp.com-20140115110038-30hgekee12evx5fm

1  2 
addons/web/static/src/js/view_list.js

@@@ -2307,5 -2308,19 +2308,18 @@@ instance.web.list.Many2Many = instance.
          return this._super(row_data, options);
      }
  });
+ instance.web.list.Reference = instance.web.list.Column.extend({
+     _format: function (row_data, options) {
+         if (!_.isEmpty(row_data[this.id].value)) {
+             // If value, use __display version for printing
 -            //console.log('_format', row_data[this.id], row_data[this.id + '__display']);
+             if (!!row_data[this.id + '__display']) {
+                 row_data[this.id] = row_data[this.id + '__display'];
+             } else {
+                 row_data[this.id] = {'value': ''};
+             }
+         }
+         return this._super(row_data, options);
+     }
+ });
  };
  // vim:et fdc=0 fdl=0 foldnestmax=3 fdm=syntax: