From 09f56b8cfdee49838ec606a226402f16a4cad134 Mon Sep 17 00:00:00 2001 From: Fabien BOURGEOIS Date: Thu, 9 Aug 2018 16:29:33 +0200 Subject: [PATCH] [REM]Web Widget Phone Check : now only render value --- web_widget_phone_check_fr/__manifest__.py | 4 ++-- .../static/src/js/web_widget_phone_check_fr.js | 12 +----------- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/web_widget_phone_check_fr/__manifest__.py b/web_widget_phone_check_fr/__manifest__.py index 7a79e15..36643e7 100644 --- a/web_widget_phone_check_fr/__manifest__.py +++ b/web_widget_phone_check_fr/__manifest__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# Copyright 2017 Fabien Bourgeois +# Copyright 2016-2018 Fabien Bourgeois # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -18,7 +18,7 @@ { 'name': 'French format phone widget check', 'summary': 'Extends Web Char widget to handle french format phone', - 'version': '10.0.1.0.1', + 'version': '10.0.1.0.2', 'category': 'Usability', 'author': 'Fabien Bourgeois', 'license': 'AGPL-3', diff --git a/web_widget_phone_check_fr/static/src/js/web_widget_phone_check_fr.js b/web_widget_phone_check_fr/static/src/js/web_widget_phone_check_fr.js index 6bead89..05c7be2 100644 --- a/web_widget_phone_check_fr/static/src/js/web_widget_phone_check_fr.js +++ b/web_widget_phone_check_fr/static/src/js/web_widget_phone_check_fr.js @@ -1,5 +1,5 @@ /* -* Copyright 2016 Fabien Bourgeois +* Copyright 2016-2018 Fabien Bourgeois * * 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 @@ -23,18 +23,8 @@ odoo.define('web.web_widget_phone_check', function(require) { var core = require('web.core'); var widget = require('web.form_widgets'); - var rePhone = /^\d{10}$/; - var FieldPhoneFr = widget.FieldChar.extend({ 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() { this._super(); if (this.get('effective_readonly')) {