Contributors mailing list archives
contributors@odoo-community.org
Browse archives
Re: Lots of our modules do not handle multi-company correctly with Odoo >= 13
Re: Lots of our modules do not handle multi-company correctly with Odoo >= 13
Re: Lots of our modules do not handle multi-company correctly with Odoo >= 13
by
Camptocamp France SAS, Alexandre Fayolle
On 09/02/2022 14:37, Holger Brunn wrote: > Thank you for raising this. > >> * gather information about affected modules and versions (so that people >> can quickly check if their instances are affected by this) > > could we write the AST version of > grep -RE 'user(_id|).company_id[^s]' --include=*.py > ? > (which already finds a lot of problematic cases, but also a lot of false > positives we could exclude when knowing the code, like in default lambdas) > > When we have that we could even flag such lines in PRs to have reviewers/ > contributors pay extra attention. > I don't think we want to exclude default lambdas. In my opinion we want env.company_id in these (and this is what Odoo is using). Tests are a bit more of an issue. We should have a pylint check for this, I think, which would require an explicit deactivation to be able to use user.company_id anywhere. -- 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 France http://www.camptocamp.com
Reference
-
Lots of our modules do not handle multi-company correctly with Odoo >= 13
byCamptocamp France SAS, Alexandre Fayolle-
Re: Lots of our modules do not handle multi-company correctly with Odoo >= 13
byAGILE BUSINESS GROUP SAGL, Simone Rubino -
Re: Lots of our modules do not handle multi-company correctly with Odoo >= 13
byAcsone SA/NV, Stéphane Bidoul -
Re: Lots of our modules do not handle multi-company correctly with Odoo >= 13
byCamptocamp France SAS, Alexandre Fayolle -
Re: Lots of our modules do not handle multi-company correctly with Odoo >= 13
by "Holger Brunn" <mail@hunki-enterprises.nl> - 09/02/2022 14:37:12 - 1 -
Re: Lots of our modules do not handle multi-company correctly with Odoo >= 13
byAcsone SA/NV, Denis Roussel
-