From 1ea62dd94c04bb59e88cf1170e08dc214b85fd19 Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Mon, 13 Aug 2012 17:45:55 +0200 Subject: [PATCH] Added protection bzr revid: nicolas.vanhoren@openerp.com-20120813154555-rw4kh1jxdbmg8xab --- 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 08d6292effa..af8cc791ac2 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -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")) {