Skip to content

Commit

Permalink
[IMP] hr_employee_id: Add support for batch creation
Browse files Browse the repository at this point in the history
- Updated the create method in models/hr_employee.py to not break batch mode create
  • Loading branch information
maisim committed Aug 16, 2024
1 parent 778ceef commit 85bd660
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions hr_employee_id/models/hr_employee.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ def _generate_identification_id(self):
)

@api.model
def create(self, vals):
if not vals.get("identification_id"):
vals["identification_id"] = self._generate_identification_id()
return super(HrEmployee, self).create(vals)
def create(self, vals_list):
records = super(HrEmployee, self).create(vals_list)

for record in records:
if not record.identification_id:
record.identification_id = record._generate_identification_id()

return records

0 comments on commit 85bd660

Please sign in to comment.