Skip to content

Commit d7f4534

Browse files
committed
Merge pull request OCA#304 from andrius-preimantas/fix_web_widget_color_required_value
[FIX][web_widget_color] Do not force mandatory color on JS level
2 parents 18a84a1 + d5974a0 commit d7f4534

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

web_widget_color/static/src/js/widget.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ openerp.web_widget_color = function (instance) {
1818
widget_class: 'oe_form_field_color',
1919
is_syntax_valid: function () {
2020
var $input = this.$('input');
21-
if (!this.get("effective_readonly") && $input.size() > 0) {
21+
if (!this.get("effective_readonly") && $input.size() > 0 && $input.val()) {
2222
var val = $input.val();
2323
var isOk = /^#[0-9A-F]{6}$/i.test(val);
2424
if (!isOk) {

web_widget_color/static/src/xml/widget.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
t-att-autofocus="widget.node.attrs.autofocus"
1010
t-att-placeholder="widget.node.attrs.placeholder"
1111
t-att-maxlength="widget.field.size"
12-
class="color {hash:true}"
12+
class="color {hash:true, required:false}"
1313
/>
1414
</t>
1515
<t t-if="widget.get('effective_readonly')">

0 commit comments

Comments
 (0)