[FIX] : website : Remove hack that was unfortunately publishing all new record

created from the frontend (NB : This fix is compatible with the new webclient)
This commit is contained in:
Yannick Tivisse
2015-07-09 16:13:04 +02:00
parent d56c35941b
commit 4f3e633d3c
@@ -9,17 +9,15 @@ var form_widgets = require('web.form_widgets'); // required to guarantee that
var WidgetWebsiteButton = form_common.AbstractField.extend({
template: 'WidgetWebsiteButton',
render_value: function() {
// Hack to replace false value by unpublished because falsy form fields
// have classname o_form_field_empty and are hidden
if (!this.get_value()) {
this.set_value('unpublished');
}
this._super();
this.$el.toggleClass("published", this.get_value() === true);
if (this.node.attrs.class) {
this.$el.addClass(this.node.attrs.class);
}
},
is_false: function() {
return false;
},
});
core.form_widget_registry.add('website_button', WidgetWebsiteButton);