This commit is contained in:
michel 2017-11-16 16:59:02 +01:00
parent e37774fff6
commit 5c2b3b0b2c

View File

@ -28,5 +28,5 @@ class CoworkerRelation(models.Model):
@api.constrains('coworker1', 'coworker2') @api.constrains('coworker1', 'coworker2')
def _check_if_coworker_is_same(self): def _check_if_coworker_is_same(self):
"""Test si coworker1 est identique à coworker2""" """Test si coworker1 est identique à coworker2"""
if not self.coworker1 != self.coworker2: if self.coworker1 == self.coworker2:
raise ValidationError(_('Coworker1 is same coworker2')) raise ValidationError(_('Coworker1 is same coworker2'))