refactor: replace SQL unique constraint with odoo.models.Constraint for hr_employee pin
This commit is contained in:
parent
406f353b98
commit
6f045a2409
@ -10,13 +10,10 @@ _logger = logging.getLogger(__name__)
|
||||
class HrEmployee(models.Model):
|
||||
_inherit = 'hr.employee'
|
||||
|
||||
_sql_constraints = [
|
||||
(
|
||||
'pin_unique',
|
||||
'UNIQUE(pin)',
|
||||
'The Employee PIN Code must be unique across all employees and companies.',
|
||||
)
|
||||
]
|
||||
_pin_unique = models.Constraint(
|
||||
'unique(pin)',
|
||||
'The Employee PIN Code must be unique across all employees and companies.',
|
||||
)
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# Helpers
|
||||
|
||||
Loading…
Reference in New Issue
Block a user