Browse Source

[FIX] add if on vals

pull/246/head
Nicola Malcontenti 9 years ago
committed by eLBati
parent
commit
fe056968a2
  1. 1
      base_field_validator/models/ir_model.py

1
base_field_validator/models/ir_model.py

@ -28,6 +28,7 @@ class IrModel(models.Model):
for validator_line in model.validator_line_ids:
if validator_line.field_id.name in vals:
pattern = re.compile(validator_line.regex_id.regex)
if vals[validator_line.field_id.name]:
if not pattern.match(vals[validator_line.field_id.name]):
raise Warning(
_('Expression %s not valid for %s') % (

Loading…
Cancel
Save