From d5974a02dcf1e1374df5b92ca8300851a9b7b330 Mon Sep 17 00:00:00 2001 From: Andrius Preimantas Date: Tue, 2 Feb 2016 15:06:03 +0200 Subject: [PATCH] [FIX][web_widget_color] Do not force mandatory color on JS level This should be taken care by required tag on field on xml view --- web_widget_color/static/src/js/widget.js | 2 +- web_widget_color/static/src/xml/widget.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/web_widget_color/static/src/js/widget.js b/web_widget_color/static/src/js/widget.js index 44299752..488a8b88 100644 --- a/web_widget_color/static/src/js/widget.js +++ b/web_widget_color/static/src/js/widget.js @@ -18,7 +18,7 @@ openerp.web_widget_color = function (instance) { widget_class: 'oe_form_field_color', is_syntax_valid: function () { var $input = this.$('input'); - if (!this.get("effective_readonly") && $input.size() > 0) { + if (!this.get("effective_readonly") && $input.size() > 0 && $input.val()) { var val = $input.val(); var isOk = /^#[0-9A-F]{6}$/i.test(val); if (!isOk) { diff --git a/web_widget_color/static/src/xml/widget.xml b/web_widget_color/static/src/xml/widget.xml index c62ae1cf..79c9ad74 100644 --- a/web_widget_color/static/src/xml/widget.xml +++ b/web_widget_color/static/src/xml/widget.xml @@ -9,7 +9,7 @@ t-att-autofocus="widget.node.attrs.autofocus" t-att-placeholder="widget.node.attrs.placeholder" t-att-maxlength="widget.field.size" - class="color {hash:true}" + class="color {hash:true, required:false}" />