Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Property Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
      • Get a Tailored Demo
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +32 2 290 34 90
    • Get a Tailored Demo
  • Pricing
  • Help
  1. APPS
  2. Extra Tools
  3. Inputmask Widget v 10.0
  4. Sales Conditions FAQ

Inputmask Widget

by Gilvan Leal https://gilvanleal.github.io/odoowidgets/
Odoo
v 10.0 v 11.0 v 12.0 Third Party 2402
Download for v 10.0 Deploy on Odoo.sh
Apps purchases are linked to your Odoo account, please sign in or sign up first.
Versions 10.0 11.0 12.0
You bought this module and need support? Click here!
Versions 10.0 11.0 12.0
  • Description
  • Manifest

Inputmask Widget

Based on jquery.inputmask 3.x Docs in GitHub.

An Inputmask Widget helps the user with the input by ensuring a predefined format.
This can be useful for dates, numerics, phone numbers, ...

Instructions:

  • Just add attribute widget="mask" and data-inputmask[-<attribute>]="<value>" to <field /> on form, tree and kanban

    Some examples:

    <field widget="mask" data-inputmask="'alias': 'date'" name="name" />
    <field widget="mask" data-inputmask="'mask': '99/99/9999'" name="name" />
    <field widget="mask" data-inputmask="'mask': '99-aa-**-AA-&amp;&amp;-##'" name="name" />
    <field widget="mask" data-inputmask="'mask': '9', 'repeat': 10, 'greedy' : false" name="name" />
    

    Or:

    <field widget="mask" data-inputmask-alias="date" name="name" />
    <field widget="mask" data-inputmask-mask="99/99/9999" name="name" />
    <field widget="mask" data-inputmask-mask="99-aa-**-AA-&amp;&amp;-##" name="name" />
    <field widget="mask" data-inputmask-mask="9" data-inputmask-repeat="10" data-inputmask-greedy="false" name="name" />
    

    Note: Use contenteditable="true" for apply mask in others HTML tags: span, div, etc. Improve

  • Just add attribute widget="mask_regex" and data-inputmask[-regex]="<value>" to <field />

    With the regex extension you can use any regular expression as a mask. Currently this does only input restriction. There is no further masking visualization.

    Example email validation:

    <field widget="regex_mask" data-inputmask-regex="[a-zA-Z0-9._%-]+@[a-zA-Z0-9-]+\.[a-zA-Z]{2,4}" name="name"/>
    
  • Widgets names use:

    mask:Char Field
    integer_mask:Integer Field
    float_mask:Float Field
    regex_mask:Char Field
    monetary_mask:in development...
  • Masking definition:

    9:Numeric value
    a:Alphabetical value
    *:Alphanumeric value
    A:Alphabetical uppercasing
    &:Alfanumeric uppercasing - (Use &amp; for escape & in XML file)
    #:Hexadecimal
  • Attributes:

    mask:The mask to use.
    repeat:Mask repeat function. Repeat the mask definition x-times.
    greedy:Toggle to allocate as much possible or the opposite. Non-greedy repeat function.
    placeholder:Change the mask placeholder. Default: "_"
    autounmask:Automatically unmask the value when retrieved. Default: false.
    removemaskonsubmit:
     *Remove the mask before submitting the form.Default: false
    clearmaskonlostfocus:
     Remove the empty mask on blur or when not empty removes the optional trailing part Default: true
    insertmode:Toggle to insert or overwrite input. Default: true.
    clearincomplete:
     Clear the incomplete input on blur.
    alias:The alias to use.
  • Aliases:

    Some aliases found in the extensions are: email, currency, decimal, integer, date, datetime, dd/mm/yyyy, url, ip, etc.

    Docs:

    • Date and Datetime
    • Numeric
    • Regex
    • Phone
    • Other
Availability
Odoo Online
Odoo.sh
On Premise
Technical Name inputmask_widget
LicenseAGPL-3
Websitehttps://gilvanleal.github.io/odoowidgets/

Please log in to comment on this module

  • The author can leave a single reply to each comment.
  • This section is meant to ask simple questions or leave a rating. Every report of a problem experienced while using the module should be addressed to the author directly (refer to the following point).
  • If you want to start a discussion with the author, please use the developer contact information. They can usually be found in the description.
  • Ratings
  • Discuss
groupSeparator not work in read mode
by
ainur rofiq
on 3/30/17, 3:46 AM

all things are good. But when I try alias:decimal with groupSeparator, the sparator is working when edit the field. but, when form is saved groupSeparator is disappear thanks


by
Gilvan Leal
on 3/20/17, 12:01 PM

Answer for Ainur Rofiq
by
Gilvan Leal
on 5/5/18, 12:49 PM Author

try this : widget="mask" data-inputmask="'alias':'decimal', 'groupSeparator':',', 'autoGroup':true"


Great Module - Need Odoo 11 version
by
G Jennings
on 10/23/17, 9:57 AM

We greatly appreciate the work with this module. When do you expect to upgrade to module to v11?


How to format float field with thousand separator
by
Nguyen Minh
on 6/25/17, 12:55 AM

This is great widget, I am trying to format a float field in xml view with thousand seperator when I input data in edit mode: 120000000 --> 120.000.000 I tried with alias like this in xml: "" But it doesn't work. I also want the mask also need to be remove when I call any function via button action in the form. Could anyone help me correct the code. Thank you a lot in advance.


How to format float field with thousand separator
by
Nguyen Minh
on 6/25/17, 12:52 AM

This is great widget, I am trying to format a float field in xml view with thousand seperator when I input data in edit mode: 120000000 --> 120.000.000 I tried with alias like this in xml: But it doesn't work. I also want the mask also need to be remove when I call any function via button action in the form. Could anyone help me correct the code. Thank you a lot in advance.


groupSeparator not work in read mode
by
ainur rofiq
on 3/30/17, 3:46 AM

all things are good. But when I try alias:decimal with groupSeparator, the sparator is working when edit the field. but, when form is saved groupSeparator is disappear thanks


groupSeparator not work in read mode
by
ainur rofiq
on 3/30/17, 3:45 AM

all things are good. But when I try alias:decimal with groupSeparator, the sparator is working when edit the field. but, when form is saved groupSeparator is disappear thanks


Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security

Odoo is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

Website made with