[REM]Web Widget Phone Check : now only render value
This commit is contained in:
parent
3ff204cc23
commit
09f56b8cfd
@ -1,6 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Copyright 2017 Fabien Bourgeois <fabien@yaltik.com>
|
# Copyright 2016-2018 Fabien Bourgeois <fabien@yaltik.com>
|
||||||
#
|
#
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU Affero General Public License as
|
# it under the terms of the GNU Affero General Public License as
|
||||||
@ -18,7 +18,7 @@
|
|||||||
{
|
{
|
||||||
'name': 'French format phone widget check',
|
'name': 'French format phone widget check',
|
||||||
'summary': 'Extends Web Char widget to handle french format phone',
|
'summary': 'Extends Web Char widget to handle french format phone',
|
||||||
'version': '10.0.1.0.1',
|
'version': '10.0.1.0.2',
|
||||||
'category': 'Usability',
|
'category': 'Usability',
|
||||||
'author': 'Fabien Bourgeois',
|
'author': 'Fabien Bourgeois',
|
||||||
'license': 'AGPL-3',
|
'license': 'AGPL-3',
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2016 Fabien Bourgeois <fabien@yaltik.com>
|
* Copyright 2016-2018 Fabien Bourgeois <fabien@yaltik.com>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify it
|
* This program is free software: you can redistribute it and/or modify it
|
||||||
* under the terms of the GNU Affero General Public License as published by
|
* under the terms of the GNU Affero General Public License as published by
|
||||||
@ -23,18 +23,8 @@ odoo.define('web.web_widget_phone_check', function(require) {
|
|||||||
var core = require('web.core');
|
var core = require('web.core');
|
||||||
var widget = require('web.form_widgets');
|
var widget = require('web.form_widgets');
|
||||||
|
|
||||||
var rePhone = /^\d{10}$/;
|
|
||||||
|
|
||||||
var FieldPhoneFr = widget.FieldChar.extend({
|
var FieldPhoneFr = widget.FieldChar.extend({
|
||||||
template: 'FieldPhoneFr',
|
template: 'FieldPhoneFr',
|
||||||
is_syntax_valid: function () {
|
|
||||||
if (this.$input) {
|
|
||||||
var val = this.$input.val() || '';
|
|
||||||
return ((val.length === 0) || rePhone.test(val));
|
|
||||||
} else {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
render_value: function() {
|
render_value: function() {
|
||||||
this._super();
|
this._super();
|
||||||
if (this.get('effective_readonly')) {
|
if (this.get('effective_readonly')) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user