@ -14,9 +14,10 @@
"data": [
'views/ir_model_view.xml',
'security/ir.model.access.csv',
'data/ir_model_regex_data.xml',
],
"demo": [
'demo/ir_model_demo.xml',
'demo/ir_model_regex_demo.yml',
'test': [
'test/validator.yml',
@ -0,0 +1,12 @@
-
set regex for partner
!python {model: ir.model}: |
self.write(cr, uid, [ref('base.model_res_partner')], {
'validator_line_ids': [(0,0,
{
'model_id': ref('base.model_res_partner'),
'field_id': ref('base.field_res_partner_email'),
'regex_id': ref('regex_mail'),
})],
})
@ -13,3 +13,7 @@ class IrModelFieldsRegex(models.Model):
help="Regular expression used to validate the field. For example, "
"you can add the expression\n%s\nto the email field"
% r'[^@]+@[^@]+\.[^@]+')
_sql_constraints = [(
'name_unique', 'unique (name)',
'The name of a regular expression must be unique'
)]
@ -1,15 +1,3 @@
Set valid email