I'm on Odoo V9 trying to import 2 files, employees.csv and departments.csv. Employees has a column that references the Department's unique id (which I've mapped to the External ID per Odoo documentation). When mapping the department's unique in Departments I select "External ID" as my field and in Employees I select "Departments/External ID". When I try to validate employees.csv I get:
insert or update on table "hr_employee" violates foreign key constraint "hr_employee_department_id_fkey" DETAIL: Key (department_id)=(1470) is not present in table "hr_department". at row 18 (3 more)
insert or update on table "hr_employee" violates foreign key constraint "hr_employee_department_id_fkey" DETAIL: Key (department_id)=(1471) is not present in table "hr_department". at row 30 (7 more)
insert or update on table "hr_employee" violates foreign key constraint "hr_employee_department_id_fkey" DETAIL: Key (department_id)=(1473) is not present in table "hr_department". at row 32 (15 more)
insert or update on table "hr_employee" violates foreign key constraint "hr_employee_department_id_fkey" DETAIL: Key (department_id)=(1472) is not present in table "hr_department". at row 392 (8 more)
insert or update on table "hr_employee" violates foreign key constraint "hr_employee_department_id_fkey" DETAIL: Key (department_id)=(1475) is not present in table "hr_department". at row 405 (1 more)
I'm not sure where that department_id is coming from. They are not the External IDs that I imported. I'm having this issue importing other related records as well. This was just the easiest to exemplify.