[19.0] Proposal: phone_autoformat - automatically format phone numbers on save
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 12/100
Research direction
This is a proposal for a new module, not a defined change, so there is no file to start from yet. Read the three open questions in the thread, since the maintainers' answers on repository placement, existing OCA coverage and the res.partner mixin approach decide whether any code is written. The issue names the phone_validation dependency and the phonenumbers library as the pieces to check. Done means a maintainer has agreed the design, and only then a PR on the 19.0 branch.
Written by the indexing model from the issue text.
Description
Summary
I'd like to propose a new module, phone_autoformat, for this repository
(branch 19.0). It formats phone numbers automatically so every number in the
database follows the same format, without users having to retype them.
Problem
Odoo stores phone numbers exactly as typed, so a database ends up with
0300 1234567, +923001234567, 0092-300-1234567 and so on. This makes
searching, matching and dialing inconsistent. Odoo core has phone_validation
(with the formatting helpers), but it does not apply them automatically to
stored fields.
What the module does
- Reformats phone fields when the user leaves the field, and again on
create/write (so imports and API calls are covered too). - Handles every stored, editable text field whose name contains
phoneor
mobile, including custom fields. - Configurable in Settings: International, E.164, National, RFC 3966, or
disabled. - Optionally allows several numbers in one field (comma/semicolon separated);
each one is formatted on its own. - Numbers that cannot be parsed are left exactly as typed.
- Uses the contact's country, then the company's country, to parse numbers
typed without a+prefix.
It depends only on base, phone_validation and the phonenumbers library
(already used by core). The module is on my fork and I have tested it on an
Odoo 19 instance. It includes tests and the standard readme/ fragments.
Questions
- Do you think this fits
server-tools, or would another repository
(for exampleconnector-telephonyorpartner-contact) be a better home? - Does an existing OCA module already cover this? I could not find one, but
I may have missed it. If so, I'm happy to contribute there instead. - Is applying the formatting through a mixin on
res.partneracceptable, or
would you prefer a different approach (for example a field widget only)?
If this is welcome, I will open a PR on the 19.0 branch and sign the CLA
through the bot as usual. Bridge modules for CRM leads and employees would
be separate, later PRs to the matching repositories.
Thanks for your time and for reviewing this!
- Dominant language
- Python
- Stars
- 960
- Forks
- 1.7k
- Avg merge
- 5d 23h
- Merged PRs (30d)
- 15
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from OCA/server-tools
-
dataclasses and python > 3.7Possibly taken A pull request linked to this issue is open or already merged. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
OCA/server-tools#3859 ·
Maintainers usually reply within 1 day
-
When tracking Json fields an error pops in v19Possibly taken @xecanto claimed this 23 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
OCA/server-tools#3796 ·
Maintainers usually reply within 1 day
-
[18.0] base_exception: swallow_base_exception_error never runs the decorated testPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
OCA/server-tools#3784 · 1 comment ·
Maintainers usually reply within 1 day
-
[17.0] auto_backup: Cron: Database backup failed, UnicodeDecodeError: utf-8 codec can't decode byte 0x8b in position 690: invalid start bytePossibly taken @xecanto claimed this 33 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
OCA/server-tools#3768 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 65/100
OCA/server-tools#3368 · 1 comment ·
Maintainers usually reply within 1 day
All issues in OCA/server-tools
Similar issues
-
add entry to blockOpen
Difficulty 1/5 Under an hour Newbie friendliness 65/100
StevenBlack/hosts#3299 ·
-
`garak --report` overwrites the input report when its name has no ".report"Possibly taken @0z5a claimed this today. Openneeds-triage
Difficulty 2/5 Half a day Newbie friendliness 72/100
Maintainers usually reply within 2 days
-
plot_graph crashes when a mesh node has no m2m edgePossibly taken @tygvi claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
mllam/neural-lam#883 · 1 comment ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
future-agi/future-agi#4092 · 1 comment ·
Maintainers usually reply within 1 day
-
transcript analytics: a text whose only protected spans the prose pass redacts is withheld wholeOpen
Difficulty 1/5 Under an hour Newbie friendliness 82/100
WingedGuardian/GENesis-AGI#4641 ·
Maintainers usually reply within 1 day