Contributors mailing list archives

Browse archives


Lots of our modules do not handle multi-company correctly with Odoo >= 13

Camptocamp France SAS, Alexandre Fayolle
- 09/02/2022 13:41:43
Dear colleagues,

It seems we have a widely spread bug on our code base, related to Odoo 
 >= 13.0 and multi-company.

Starting on Odoo 13.0 the company switch widget in the UI no longer 
changes the user's company_id field. It changes the company via the 
force_company context key, and you get the value of the current company 
by checking ``, and not any longer through 

This is documented in

However, in many places in our code base, I see things such as 

This calls for a massive bug fix campaign (and probably for an official 
statement from the community to ask customers to upgrade their modules 
if they are in multi-company).

I am not sure what the best course of action is.

Things I think we should do:

* gather information about affected modules and versions (so that people 
can quickly check if their instances are affected by this)
* prepare fixes and get them applied
* publish the fix versions
* be super careful about this in the reviews of module migration pull 
requests (I admit I have been careless on this, and I really feel bad 
about it)

Feedback welcome,

Alexandre Fayolle
Senior Software Engineer
Tel : +33 4 58 48 20 30

Camptocamp France SAS
18 rue du Lac Saint André
73 370 Le Bourget-du-Lac