Fields Validator

base_field_validator
REPOSITORY
REPOSITORYOCA/server-tools
GIT
GIThttps://github.com/OCA/server-tools.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/server-tools/tree/8.0/base_field_validator
VERSION
VERSION 1.0.0
CATEGORY
CATEGORYTools
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSOdoo Community Association (OCA), Agile Business Group
MAINTAINERS
MAINTAINERSOdoo Community Association (OCA), Agile Business Group
COMMITTERS
COMMITTERSeLBati, GitHub, OCA Transbot, oca-travis, Weblate
WEBSITE
WEBSITEhttp://www.agilebg.com
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:11:25
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - base
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION

Code Analysis

Views touched (1)
XML IDNameModelTypeStatus
view_model_form_validator ir.model notebook Inherits base.view_model_form
Models touched (3)

New fields (1)
  • validator_line_ids One2many → ir.model.validator.line
    args: 'ir.model.validator.line', 'model_id', 'Validators'
Public methods (3)
  • check_vals(self, vals, model_name)
    @api.model
  • create(self, cr, uid, vals, context=None)
  • write(self, cr, uid, ids, vals, context=None)

New fields (2)
  • name Char
    required=True args: 'Description'
  • regex Char
    help=<expr> required=True args: 'Regular Expression'
Public methods (0)

No public methods.

New fields (3)
  • field_id Many2one → ir.model.fields
    required=True args: 'ir.model.fields', 'Field'
  • model_id Many2one → ir.model
    required=True string='Model' args: 'ir.model'
  • regex_id Many2one → ir.model.fields.regex
    required=True string='Validator' args: 'ir.model.fields.regex'
Public methods (0)

No public methods.

REPOSITORY
REPOSITORYOCA/server-tools
GIT
GIThttps://github.com/OCA/server-tools.git
GIT FOLDER
GIT FOLDERhttps://github.com/OCA/server-tools/tree/7.0/base_field_validator
VERSION
VERSION 0.1
CATEGORY
CATEGORYTools
LICENSE
LICENSEAGPL-3
APPLICATION
APPLICATIONNo
AUTO-INSTALLABLE
AUTO-INSTALLABLENo
AUTHORS
AUTHORSAgile Business Group
MAINTAINERS
MAINTAINERSAgile Business Group
COMMITTERS
COMMITTERSeLBati
WEBSITE
WEBSITEhttp://www.agilebg.com
LAST TRACKING UPDATE
LAST TRACKING UPDATE2026-07-06 00:07:15
ODOO DEPENDENCIES
ODOO DEPENDENCIES odoo/odoo:
    - base
PYTHON DEPENDENCIES
PYTHON DEPENDENCIES Not have
SYSTEM DEPENDENCIES
SYSTEM DEPENDENCIES Not have
DESCRIPTION
DESCRIPTION
Fields Validator
================

This module allows to set a regular expression as field validator.
When the regular expresion is set, write and create operations on the involved
field are blocked, if the regular expression is not satisfied.
See demo and test data for an example with partner email.


Configuration
=============

Open ir.model form (say res.partner) and add 'Validators' lines


Known issues / Roadmap
======================

The module performs the check at server side. Client side check is also needed,
to improve user experience and avoid server calls when unnecessary


Credits
=======

Contributors
------------

* Lorenzo Battistini <lorenzo.battistini@agilebg.com>
* Nicola Malcontenti <nicola.malcontenti@agilebg.com>

Maintainer
----------

.. image:: http://odoo-community.org/logo.png
   :alt: Odoo Community Association
   :target: http://odoo-community.org

This module is maintained by the OCA.

OCA, or the Odoo Community Association, is a nonprofit organization
whose mission is to support the collaborative development of Odoo features
and promote its widespread use.

To contribute to this module, please visit http://odoo-community.org.

Code Analysis

Views touched (1)
XML IDNameModelTypeStatus
view_model_form_validator ir.model notebook Inherits base.view_model_form
Models touched (3)

New fields (0)

No new fields.

Public methods (3)
  • check_vals(self, cr, uid, vals, model, context=None)
  • create(self, cr, uid, vals, context=None)
  • write(self, cr, uid, ids, vals, context=None)

New fields (0)

No new fields.

Public methods (0)

No public methods.

New fields (0)

No new fields.

Public methods (0)

No public methods.