| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Contacts (contacts)
• Discuss (mail) |
| Lines of code | 188 |
| Technical Name |
mindscript_masked_input |
| License | OPL-1 |
| Website | https://www.mindscriptech.com/ |
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
Contacts (contacts)
• Discuss (mail) |
| Lines of code | 188 |
| Technical Name |
mindscript_masked_input |
| License | OPL-1 |
| Website | https://www.mindscriptech.com/ |
Masked Input Widget
A backend field widget that enforces a fixed input format live, as the user types. Give a char field a mask like xxxx-xxxxxxx and it formats a phone as 0300-1234567 on the fly, blocks characters that do not fit, inserts the literals (-, /, spaces) for you, shows the required format as a hint, and flags an inline error if the value is incomplete on blur. No new models, no stored data, the field keeps its normal value, just cleanly formatted.
What This Module Does
Free-text fields drift into a dozen inconsistent shapes: phone numbers with and without dashes, ID codes with stray spaces, tax numbers nobody can search. This widget locks a field to one format and guides the user into it while they type.
How it works
Add the widget to a char field, hand it a mask, and the format is enforced everywhere that field appears.
- Install the module. The contact phone field is already wired to the masked_input widget as a working example.
- To use it elsewhere, set widget="masked_input" on any char field in a form view and pass a mask via options.
- Build the mask from tokens: x for a digit, a for a letter, * for either, plus any literal characters (-, /, space) you want inserted automatically.
- As the user types, the value is formatted live, off-pattern keys are blocked, and an inline error shows on blur if it is incomplete.
See It in Action
From the format hint, through live formatting as you type, to the inline error on an incomplete value.
Helping businesses work smarter with tailored Odoo solutions. We deliver custom modules, integrations, and workflow improvements designed for your needs.
Odoo Proprietary License v1.0 This software and associated files (the "Software") may only be used (executed, modified, executed after modifications) if you have purchased a valid license from the authors, typically via Odoo Apps, or if you have received a written agreement from the authors of the Software (see the COPYRIGHT file). You may develop Odoo modules that use the Software as a library (typically by depending on it, importing it and using its resources), but without copying any source code or material from the Software. You may distribute those modules under the license of your choice, provided that this license is compatible with the terms of the Odoo Proprietary License (For example: LGPL, MIT, or proprietary licenses similar to this one). It is forbidden to publish, distribute, sublicense, or sell copies of the Software or modified copies of the Software. The above copyright notice and this permission notice must be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Please log in to comment on this module