forked from Techsystech/web
Merge pull request #325 from initOS/8.0-web_widget_one2many_tags-empty-field
8.0 web widget one2many tags empty field8.0
commit
1249a2ba6e
|
@ -37,6 +37,7 @@ Contributors
|
||||||
|
|
||||||
* Holger Brunn <hbrunn@therp.nl>
|
* Holger Brunn <hbrunn@therp.nl>
|
||||||
* Iván Todorovich <ivan.todorovich@gmail.com>
|
* Iván Todorovich <ivan.todorovich@gmail.com>
|
||||||
|
* Peter Hahn <peter.hahn@initos.com>
|
||||||
|
|
||||||
Maintainer
|
Maintainer
|
||||||
----------
|
----------
|
||||||
|
|
|
@ -82,8 +82,15 @@ openerp.web_widget_one2many_tags = function(instance)
|
||||||
init: function () {
|
init: function () {
|
||||||
this._super.apply(this, arguments);
|
this._super.apply(this, arguments);
|
||||||
// Treat it as many2many to trick odoo into populating '__display'.
|
// Treat it as many2many to trick odoo into populating '__display'.
|
||||||
|
// note: this has been fixed in core OCB recently
|
||||||
this.type = 'many2many';
|
this.type = 'many2many';
|
||||||
},
|
},
|
||||||
|
_format: function (row_data, options) {
|
||||||
|
if (_.isEmpty(row_data[this.id].value)) {
|
||||||
|
row_data[this.id] = {'value': false};
|
||||||
|
}
|
||||||
|
return this._super(row_data, options);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
instance.web.list.columns.add(
|
instance.web.list.columns.add(
|
||||||
|
|
Loading…
Reference in New Issue