Odoo Help


How can we assign the right department to an employee in a multi-company environment?

Yves Geoffroy
on 4/1/14, 1:01 PM 2,017 views

In a multi company environment, I created the same department structure (HR configuration) for all the companies ... sales, accounting, finance, production, etc. When I want to assign a department to an employee, who belongs to a company (company_id), I see all the departments of all companies but the company name associated to the department is not listed. So I can see 5 times "sales", 5 times "accounting", etc. I think we should see only the departments of the company id of the employee! Is it a bug or am I missing something?


I understand I can allow access to one company at a time for my superuser but it's a little painfull.

Yves Geoffroy
on 4/1/14, 5:07 PM

Yes, this is an annoying problem. The workaround I have used is to create departments with the company initials like Sales (ABA) and Sales (DRD). When selecting, I know the employee's company (is listed) and select the right one. It's more work on our end, and seems like something the system should be wary of. However, I'm sure if it forced you to select only that employee's company, there would be another use-case where someone wanted to put them in another company department for some reason.

Elephante, Sean Samborski
on 4/10/14, 2:17 AM

Good idea, I will put the company's initials.

Yves Geoffroy
on 4/11/14, 7:30 PM

Med Said BARA

--Med Said BARA--

| 5 5 7
--Med Said BARA--
Med Said BARA
On 4/1/14, 9:31 PM


You are right; but i don't know if we can call it a " bug", so let's call it "a missing functionality".

When browsing the code in hr.py (HR module), you can see that there is a method "onchange_company" for the class hr_employee, which is executed when you select the company in the hr_view; but unfortunately it' just used to fill the company adress.

We can do the same, for the hr_job class, to filter only the departments belonging to the related company.

Maybe, we can do it with the same method (onchange_company), by returning 2 values instead of one, one for the adress_id and the second for department_id.

But how can we achieve this task , without patch, and patch again after each update?

In fact, i am also facing a similar issue, in sale order, when selecting a Shop or a Pricelist, i get the full list of Shops and PriceLists from all companies ...

This is really an annoying situation.

Yves, keep connected, and follow this question.

Best regards.

Thanks for answering!

Yves Geoffroy
on 4/4/14, 10:24 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 4/1/14, 1:01 PM
Seen: 2017 times
Last updated: 3/16/15, 8:10 AM