8169f640010b23706f239233fd00761b67933b1f
The problem is that when you archive a company and then install subcontracting, you get a traceback. Step to reproduce (in a multi-company environment): -install 'stock' -archive a company -install 'mrp_subcontracting' -->traceback Explanation: When installing the 'mrp_subcontracting', there's a search on all (active) companies in order to add a subcontracting location for each of them (this is is triggered by '/odoo/addons/mrp_subcontracting/data/mrp_subcontracting_data.xml'). But there is still a warehouse linked to the archived company. So when adding routes to all warehouses and looking for the subcontracting location of the archived company, it is set to False. Which is not intended and causes the traceback. Solution: Add '.with_context(active_test=False)' to the search for the companies in '_create_missing_subcontracting_location(self)', so the missing subcontracting location will be created for the archived companies too. Discussion: -The ability to archive companies is new to Odoo16 (implemented due to the new pricing). -Here I considered that we want to create a subcontracting location for an archived company instead of taking action on the warehouse linked to the archived company (like not considering it when creating routes). I did this because a company can be unarchived and with this fix, it will not cause issues. -I think other problems similar to this one (in any app), should appear in the future. opw-3039495 closes odoo/odoo#107168 X-original-commit: 1dcdbe9e3cc21af50ed580c032b1927e21c3c24b Signed-off-by: William Henrotin (whe) <whe@odoo.com>
…
…
Odoo
Odoo is a suite of web based open source business apps.
The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, ...
Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.
Getting started with Odoo
For a standard installation please follow the Setup instructions from the documentation.
To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with the developer tutorials
Languages
Python
49.6%
JavaScript
47.8%
SCSS
2%
CSS
0.3%
HTML
0.2%