summaryrefslogtreecommitdiff
path: root/addons/web/static/src
diff options
context:
space:
mode:
authorniv-openerp <nicolas.vanhoren@openerp.com>2012-08-13 17:45:55 +0200
committerniv-openerp <nicolas.vanhoren@openerp.com>2012-08-13 17:45:55 +0200
commit1ea62dd94c04bb59e88cf1170e08dc214b85fd19 (patch)
tree70c2dd8e37c2dbb7f368154a7d0d2360dda27dd6 /addons/web/static/src
parent235f8996bf33a99e5f6c17328834e406274cdff9 (diff)
Added protection
bzr revid: nicolas.vanhoren@openerp.com-20120813154555-rw4kh1jxdbmg8xab
Diffstat (limited to 'addons/web/static/src')
-rw-r--r--addons/web/static/src/js/view_form.js7
1 files changed, 7 insertions, 0 deletions
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")) {