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):
|
class HrEmployee(models.Model):
|
||||||
_inherit = 'hr.employee'
|
_inherit = 'hr.employee'
|
||||||
|
|
||||||
_sql_constraints = [
|
_pin_unique = models.Constraint(
|
||||||
(
|
'unique(pin)',
|
||||||
'pin_unique',
|
|
||||||
'UNIQUE(pin)',
|
|
||||||
'The Employee PIN Code must be unique across all employees and companies.',
|
'The Employee PIN Code must be unique across all employees and companies.',
|
||||||
)
|
)
|
||||||
]
|
|
||||||
|
|
||||||
# ------------------------------------------------------------------
|
# ------------------------------------------------------------------
|
||||||
# Helpers
|
# Helpers
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user