mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
[10.0] web_widget_color allow empty values (#1130)
* check the imput only if something has been entered in the field, don't check it if the value is empty as the field might not be required. * don't require a value and let Odoo if the field has to be required or not.
This commit is contained in:
committed by
Pedro M. Baeza
parent
0c4a5cca96
commit
98e32b8791
@@ -8,7 +8,7 @@
|
||||
{
|
||||
'name': "Web Widget Color",
|
||||
'category': "web",
|
||||
'version': "10.0.1.0.0",
|
||||
'version': "10.0.1.0.1",
|
||||
"author": "Savoir-faire Linux, "
|
||||
"Anybox, "
|
||||
"Taktik SA, "
|
||||
|
||||
@@ -22,7 +22,7 @@ odoo.define('web.web_widget_color', function(require) {
|
||||
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().length>0) {
|
||||
var val = $input.val();
|
||||
var isOk = /^#[0-9A-F]{6}$/i.test(val);
|
||||
if (!isOk) {
|
||||
|
||||
@@ -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}"
|
||||
/>
|
||||
</t>
|
||||
<t t-if="widget.get('effective_readonly')">
|
||||
|
||||
Reference in New Issue
Block a user