forked from Techsystech/web
[FIX][web_widget_color] Do not force mandatory color on JS level
This should be taken care by required tag on field on xml view8.0
parent
90ce428753
commit
d5974a02dc
|
@ -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) {
|
||||||
|
|
|
@ -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')">
|
||||||
|
|
Loading…
Reference in New Issue