From 8126882b0ea69504976b27ff70032341a1cf9a93 Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Mon, 10 Sep 2012 15:57:47 +0200 Subject: [PATCH] [IMP] added arguments to widget html bzr revid: nicolas.vanhoren@openerp.com-20120910135747-azld1lovg6d7w23c --- addons/web/static/src/js/view_form.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 744aa8d000d..08c9b96660e 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -2398,6 +2398,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' && ! this.options.safe) { + 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")) {