[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:
@@ -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
|
||||
},
|
||||
|
||||
@@ -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': {
|
||||
|
||||
Reference in New Issue
Block a user