can anyone help me about the function below:
modelObj = self.env['hr.employee']
for record in self:
rec = modelObj.search([('name, '=', record.name),('passport_id', '=', record.passport_id)])
if len(rec) > 1:
''' I need here all employees with the same name&passport to be same sequence number '''
else: self['code1'] = self.env['ir.sequence'].next_by_code('new_code1') or _('New')