fix
This commit is contained in:
parent
1a2b5f083a
commit
d4d1f268dc
|
|
@ -256,10 +256,10 @@ class HrEmployee(models.Model):
|
|||
emp_seq = self.env['hr.employee'].search([('active', 'in', [False, True])])
|
||||
|
||||
numbers = [int(emp.emp_no) for emp in emp_seq if emp.emp_no and emp.emp_no.isdigit()]
|
||||
max_number = max(numbers) if numbers else 0
|
||||
max_number = max(numbers) if numbers else 0
|
||||
|
||||
# Ensure the sequence matches the max number + 1
|
||||
if int(seq) != (max_number + 1):
|
||||
if seq.isdigit() and int(seq) != (max_number + 1):
|
||||
currnt_sequence = self.env['ir.sequence'].search([('code', '=', 'hr.employee')], limit=1)
|
||||
currnt_sequence.write({'number_next_actual': max_number + 1})
|
||||
seq = self.env['ir.sequence'].next_by_code('hr.employee') or '/'
|
||||
|
|
|
|||
Loading…
Reference in New Issue