[fix] problem with required attrs
bzr revid: nicolas.vanhoren@openerp.com-20120502114215-ezdqmbpe2j2yafdv
This commit is contained in:
parent
3961551760
commit
253cfdd59d
|
@ -1417,10 +1417,6 @@ instance.web.form.FormWidget = instance.web.Widget.extend(_.extend({}, instance.
|
||||||
this._super();
|
this._super();
|
||||||
this.$element.addClass(this.node.attrs["class"] || "");
|
this.$element.addClass(this.node.attrs["class"] || "");
|
||||||
},
|
},
|
||||||
start: function() {
|
|
||||||
this._super();
|
|
||||||
instance.web.form.InvisibilityChangerMixin.start.call(this);
|
|
||||||
},
|
|
||||||
destroy: function() {
|
destroy: function() {
|
||||||
$.fn.tipsy.clear();
|
$.fn.tipsy.clear();
|
||||||
this._super.apply(this, arguments);
|
this._super.apply(this, arguments);
|
||||||
|
@ -1710,8 +1706,8 @@ instance.web.form.AbstractField = instance.web.form.FormWidget.extend(_.extend({
|
||||||
this._check_css_flags();
|
this._check_css_flags();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
start: function() {
|
renderElement: function() {
|
||||||
this._super.apply(this, arguments);
|
this._super();
|
||||||
if (this.field.translate) {
|
if (this.field.translate) {
|
||||||
this.$element.addClass('oe_form_field_translatable');
|
this.$element.addClass('oe_form_field_translatable');
|
||||||
this.$element.find('.oe_field_translate').click(_.bind(function() {
|
this.$element.find('.oe_field_translate').click(_.bind(function() {
|
||||||
|
@ -1722,13 +1718,17 @@ instance.web.form.AbstractField = instance.web.form.FormWidget.extend(_.extend({
|
||||||
this.do_attach_tooltip(this, this.view.$element.find('label[for=' + this.id_for_label + ']')[0] || this.$element);
|
this.do_attach_tooltip(this, this.view.$element.find('label[for=' + this.id_for_label + ']')[0] || this.$element);
|
||||||
}
|
}
|
||||||
if (!this.disable_utility_classes) {
|
if (!this.disable_utility_classes) {
|
||||||
var set_required = function() {
|
this.off("change:required", this, this._set_required);
|
||||||
this.$element.toggleClass('oe_form_required', this.get("required"));
|
this.on("change:required", this, this._set_required);
|
||||||
};
|
this._set_required();
|
||||||
this.on("change:required", this, set_required);
|
|
||||||
_.bind(set_required, this)();
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* Private. Do not use.
|
||||||
|
*/
|
||||||
|
_set_required: function() {
|
||||||
|
this.$element.toggleClass('oe_form_required', this.get("required"));
|
||||||
|
},
|
||||||
set_value: function(value_) {
|
set_value: function(value_) {
|
||||||
this._inhibit_on_change = true;
|
this._inhibit_on_change = true;
|
||||||
this.set({'value': value_});
|
this.set({'value': value_});
|
||||||
|
|
Loading…
Reference in New Issue