Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
965d133
Adaugă modulul `deltatech_invoice_picking_automatically`
dhongu Aug 27, 2025
0dd246e
Actualizează documentația și resursele modulelor
dhongu Aug 27, 2025
7d90b4d
Adaugă modulul `deltatech_account_edit_currency_rate`
dhongu Aug 29, 2025
c68c33f
[IMP] Adaugă metadate pentru proiecte și elimină dependințe
dhongu Nov 9, 2025
01f80a1
[IMP] Refactorizarea validării adreselor și adăugarea de teste (#2394)
dhongu Mar 14, 2026
cfddda1
Actualizează versiunea modulului la 19.0.0.0.0
dhongu Mar 14, 2026
925b49a
[REM] Elimină validarea TVA din modulul `deltatech_website_vat_valida…
dhongu Mar 14, 2026
96daaeb
adaugare phone validation
dhongu Oct 16, 2024
59d5539
update
dhongu Oct 22, 2024
46f4535
Add static files and initialize stock account module
dhongu Jan 26, 2025
97d24b4
Corectează formatarea și adaugă funcționalități noi.
dhongu Feb 27, 2025
18a643b
[18.0][UPD] deltatech_alternative
VoicuStefan2001 Feb 27, 2025
8afb8f0
Normalize whitespace in README content across modules
dhongu Mar 3, 2025
122aa9c
[18.0][UPD deltatech_picking_transit
VoicuStefan2001 Mar 4, 2025
10237ca
Uniformizează formatările în fișierele README
dhongu Mar 21, 2025
f812f3e
pre-commit
VoicuStefan2001 Mar 24, 2025
71a4189
Actualizează formatarea fișierelor README
dhongu May 12, 2025
5552526
Adaugă script pentru copierea imaginilor în module
dhongu Jun 5, 2025
e094a2f
Elimină definirea licenței din fișierele de documentație
dhongu Jun 12, 2025
8eb2cc8
[IMP] Adaugă metadate pentru proiecte și elimină dependințe
dhongu Nov 9, 2025
dd0883d
[ADD] Adaugă noi dependințe și actualizează metadatele
dhongu Nov 9, 2025
fd0e46a
[IMP] Refactorizarea validării adreselor și adăugarea de teste (#2394)
dhongu Mar 14, 2026
b5b6171
[IMP] deltatech_website_phone_validation: pre-commit stuff
dhongu Mar 14, 2026
6c4d2be
[IMP] Actualizare versiune și curățare cod neutilizat
dhongu Mar 14, 2026
4f1620e
[IMP] Înlocuiește importul `MockRequest` cu versiune actualizată
dhongu Mar 14, 2026
8bb6892
[FIX] Elimină parametrul `is_main_address` din testele de validare
dhongu Mar 14, 2026
ad14d9c
[FIX] Adaugă parametrul `is_main_address` în testele de validare
dhongu Mar 14, 2026
a0772f7
[FIX] Înlocuiește referința `request.env["res.users"]` cu `request.en…
dhongu Mar 14, 2026
8084309
[IMP] Actualizează importul `MockRequest` în testele modulului
dhongu Mar 14, 2026
aa69b09
Merge branch '19.0-mig-deltatech_website_vat_validation' into 19.0-mi…
dhongu Mar 14, 2026
0b0a0cb
[FIX] Specifică explicit parametrii în apelurile metodei `_validate_a…
dhongu Mar 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions deltatech_website_phone_validation/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
========================
Website Phone Validation
========================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:c6c48270cc97386acbc6dbf20c550a6bafe568f720fe4f96cf45d2f3e7ff2cee
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Mature-brightgreen.png
:target: https://odoo-community.org/page/development-status
:alt: Mature
.. |badge2| image:: https://img.shields.io/badge/github-dhongu%2Fdeltatech-lightgray.png?logo=github
:target: https://github.com/dhongu/deltatech/tree/18.0/deltatech_website_phone_validation
:alt: dhongu/deltatech

|badge1| |badge2|

- Features:

- Validation of phone number from frontend
- Validare telefon in frontend

**Table of contents**

.. contents::
:local:

Bug Tracker
===========

Bugs are tracked on `Terrabit Issues <https://www.terrabit.ro/helpdesk>`_.
In case of trouble, please check there if your issue has already been reported.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* Terrabit
* Dorin Hongu

Maintainers
-----------

.. |maintainer-dhongu| image:: https://github.com/dhongu.png?size=40px
:target: https://github.com/dhongu
:alt: dhongu

Current maintainer:

|maintainer-dhongu|

This module is part of the `dhongu/deltatech <https://github.com/dhongu/deltatech/tree/18.0/deltatech_website_phone_validation>`_ project on GitHub.

You are welcome to contribute.
5 changes: 5 additions & 0 deletions deltatech_website_phone_validation/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# © 2008-2021 Deltatech
# Dorin Hongu <dhongu(@)gmail(.)com
# See README.rst file on addons root folder for license details

from . import controllers
18 changes: 18 additions & 0 deletions deltatech_website_phone_validation/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# © 2008-2021 Deltatech
# Dorin Hongu <dhongu(@)gmail(.)com
# See README.rst file on addons root folder for license details

{
"name": "Website Phone Validation",
"summary": "Phone Validation",
"version": "19.0.1.0.0",
"author": "Terrabit, Dorin Hongu",
"website": "https://www.terrabit.ro",
"external_dependencies": {"python": ["phonenumbers"]},
"license": "OPL-1",
"category": "Generic Modules",
"depends": ["website_sale", "phone_validation"],
"images": ["static/description/main_screenshot.png"],
"development_status": "Mature",
"maintainers": ["dhongu"],
}
6 changes: 6 additions & 0 deletions deltatech_website_phone_validation/controllers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# © 2008-2021 Deltatech
# Dorin Hongu <dhongu(@)gmail(.)com
# See README.rst file on addons root folder for license details


from . import website_sale
51 changes: 51 additions & 0 deletions deltatech_website_phone_validation/controllers/website_sale.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# © 2008-2021 Deltatech
# Dorin Hongu <dhongu(@)gmail(.)com
# See README.rst file on addons root folder for license details

from odoo import _
from odoo.http import request

from odoo.addons.phone_validation.tools import phone_validation
from odoo.addons.website_sale.controllers.main import WebsiteSale


class WebsiteSalePhoneValidation(WebsiteSale):
def _validate_address_values(
self,
address_values,
partner_sudo,
address_type,
use_delivery_as_billing,
required_fields,
is_main_address,
**_kwargs,
):
if address_values.get("phone"):
address_values["phone"] = address_values.get("phone").strip()

invalid_fields, missing_fields, error_messages = super()._validate_address_values(
address_values=address_values,
partner_sudo=partner_sudo,
address_type=address_type,
use_delivery_as_billing=use_delivery_as_billing,
required_fields=required_fields,
is_main_address=is_main_address,
**_kwargs,
)

if address_values.get("phone") and "phone" not in invalid_fields:
try:
phone = address_values.get("phone")
country = request.env["res.country"].sudo().browse(address_values.get("country_id"))
address_values["phone"] = phone_validation.phone_format(
phone,
country.code if country else None,
country.phone_code if country else None,
force_format="INTERNATIONAL",
raise_exception=True,
)
except Exception as e:
invalid_fields.add("phone")
error_messages.append(_("The phone number is not valid: %s", getattr(e, "name", str(e))))

return invalid_fields, missing_fields, error_messages
23 changes: 23 additions & 0 deletions deltatech_website_phone_validation/i18n/ro.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Translation of Odoo Server.
# This file contains the translation of the following module:
# * deltatech_website_phone_validation
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 18.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-03-14 07:30+0000\n"
"PO-Revision-Date: 2024-03-14 07:30+0000\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: ro\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=3; plural=(n==1?0:(((n%100>19)||(n%100==0)&&(n!=0))?2:1));\n"

#. module: deltatech_website_phone_validation
#. python-format
#: code:addons/deltatech_website_phone_validation/controllers/website_sale.py:0
msgid "The phone number is not valid: %s"
msgstr "Numărul de telefon nu este valid: %s"
9 changes: 9 additions & 0 deletions deltatech_website_phone_validation/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[build-system]
requires = [
"whool",
]
build-backend = "whool.buildapi"

[project]
name = "odoo-addon-deltatech-website-phone-validation"
dependencies = ["phonenumbers"]
4 changes: 4 additions & 0 deletions deltatech_website_phone_validation/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- Features:

- Validation of phone number from frontend
- Validare telefon in frontend
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading