|
|
@ -20,19 +20,21 @@ class ResPartnerIdCategory(models.Model): |
|
|
|
_name = "res.partner.id_category" |
|
|
|
_order = "name" |
|
|
|
|
|
|
|
def _default_validation_code(self): |
|
|
|
return _("\n# Python code. Use failed = True to specify that the id " |
|
|
|
"number is not valid.\n" |
|
|
|
"# You can use the following variables :\n" |
|
|
|
"# - self: browse_record of the current ID Category " |
|
|
|
"browse_record\n" |
|
|
|
"# - id_number: browse_record of ID number to validate") |
|
|
|
|
|
|
|
code = fields.Char(string="Code", size=16, required=True) |
|
|
|
name = fields.Char(string="ID name", required=True, translate=True) |
|
|
|
active = fields.Boolean(string="Active", default=True) |
|
|
|
validation_code = fields.Text( |
|
|
|
'Python validation code', |
|
|
|
help="Python code called to validate an id number.", |
|
|
|
default=""" |
|
|
|
# Python code. Use failed = True to specify that the id number is not valid. |
|
|
|
# You can use the following variables : |
|
|
|
# - self: browse_record of the current ID Category browse_record |
|
|
|
# - id_number: browse_record of ID number to validte |
|
|
|
""" |
|
|
|
) |
|
|
|
default=_default_validation_code) |
|
|
|
|
|
|
|
@api.multi |
|
|
|
def _validation_eval_context(self, id_number): |
|
|
|