[FIX] mrp, purchase_stock: wrong company on rules

Usecase to reproduce:
- Install a database with demo date and mrp or purchase

The buy/manufacture rules have a wrong company for warehouses
in company 'My company, Chicago'

It happens because the warehouse is not specify in the create
values. In this case it creates the rules and set the user current
company as default.

This commit specify the company during the create call.

closes odoo/odoo#28682
This commit is contained in:
Arnold Moyaux
2018-11-14 13:49:24 +00:00
parent 50e5f73b4e
commit 4f080a6605
2 changed files with 2 additions and 0 deletions
+1
View File
@@ -110,6 +110,7 @@ class StockWarehouse(models.Model):
'create_values': {
'action': 'manufacture',
'procure_method': 'make_to_order',
'company_id': self.company_id.id,
'picking_type_id': self.manu_type_id.id,
'route_id': self._find_global_route('mrp.route_warehouse0_manufacture', _('Manufacture')).id
},
+1
View File
@@ -125,6 +125,7 @@ class StockWarehouse(models.Model):
'action': 'buy',
'picking_type_id': self.in_type_id.id,
'group_propagation_option': 'none',
'company_id': self.company_id.id,
'route_id': self._find_global_route('purchase_stock.route_warehouse0_buy', _('Buy')).id
},
'update_values': {