Added protection

bzr revid: nicolas.vanhoren@openerp.com-20120813154555-rw4kh1jxdbmg8xab
This commit is contained in:
niv-openerp
2012-08-13 17:45:55 +02:00
parent 235f8996bf
commit 1ea62dd94c
+7
View File
@@ -2396,6 +2396,13 @@ instance.web.form.FieldText = instance.web.form.AbstractField.extend(instance.we
*/
instance.web.form.FieldTextHtml = instance.web.form.AbstractField.extend(instance.web.form.ReinitializeFieldMixin, {
template: 'FieldTextHtml',
init: function() {
this._super.apply(this, arguments);
if (this.field.type !== 'html') {
throw new Error(_.str.sprintf(
_t("Error with field %s, it is not allowed to use the widget 'html' with any other field type than 'html'"), this.string));
}
},
initialize_content: function() {
var self = this;
if (! this.get("effective_readonly")) {