In our sales system we need to perform different sales on behalf of different companies (actually, there are two). For this we created two companies, two warehouses (because "company" field in quotation form is read-only) and assigned these warehouses to different companies. Then, when we create quotation, we can choose different warehouses for it. According to selected warehouse, quotation's company_id (quotation->edit->other info->company) should change automatically (on the form it is read-only). But it doesn't happen!
What are we doing wrong?
Exact steps to reproduce:
1) Create new DB in odoo 8.
2) Install "sales" and "stock" apps.
3) Enable multiple companies (Settings->General settings->Manage multiple companies).
4) Create second company ("Your Company" already exists): Settings->companies.
5) Enable "multiple locations" (Settings->Warehouse->Manage multiple locations and warehouse).
6) Create second warehouse (Warehouse->warehouses).
7) Edit both warehouses and set "location" to different companies.
8) Do the same for "owner" field in Warehouse->locations.
9) Create sample customer and product.
10) Create a quotation with 1 product and try to change it's "warehouse".
Expected results:
When editing quotation and changing "warehouse", "company" field should also change automatically.
Actual results:
It does not.
Technical details:
We looked into underlying postgresql db. In "stock_warehouse" table there is "company_id" field - but it cannot be changed from UI and is always set to 1. If we manually change it - company change on warehouse change (on the "quotation" form) begins to actually happen! BUT - the results are not preserved in DB (quotation is still assigned to company #1).