3
0
Fork 0

[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
8.0
Andrius Preimantas 2016-02-02 15:06:03 +02:00
parent 90ce428753
commit d5974a02dc
2 changed files with 2 additions and 2 deletions

View File

@ -18,7 +18,7 @@ openerp.web_widget_color = function (instance) {
widget_class: 'oe_form_field_color', widget_class: 'oe_form_field_color',
is_syntax_valid: function () { is_syntax_valid: function () {
var $input = this.$('input'); 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 val = $input.val();
var isOk = /^#[0-9A-F]{6}$/i.test(val); var isOk = /^#[0-9A-F]{6}$/i.test(val);
if (!isOk) { if (!isOk) {

View File

@ -9,7 +9,7 @@
t-att-autofocus="widget.node.attrs.autofocus" t-att-autofocus="widget.node.attrs.autofocus"
t-att-placeholder="widget.node.attrs.placeholder" t-att-placeholder="widget.node.attrs.placeholder"
t-att-maxlength="widget.field.size" t-att-maxlength="widget.field.size"
class="color {hash:true}" class="color {hash:true, required:false}"
/> />
</t> </t>
<t t-if="widget.get('effective_readonly')"> <t t-if="widget.get('effective_readonly')">