From a16f3e1f191d60d39710430702bc07863bf42ece Mon Sep 17 00:00:00 2001 From: Kitti U Date: Thu, 15 Apr 2021 22:46:23 +0700 Subject: [PATCH] [FIX] stock.request's location_id conflict with stock.request.order's --- stock_request_direction/models/stock_request.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stock_request_direction/models/stock_request.py b/stock_request_direction/models/stock_request.py index 03a0611ed..8c150edb5 100644 --- a/stock_request_direction/models/stock_request.py +++ b/stock_request_direction/models/stock_request.py @@ -17,8 +17,8 @@ class StockRequest(models.Model): @api.onchange("direction") def _onchange_location_id(self): if self.direction == "outbound": - # Partner Locations/Customers - self.location_id = self.env.ref("stock.stock_location_customers") + # Stock Location set to Partner Locations/Customers + self.location_id = self.company_id.partner_id.property_stock_customer.id else: # Otherwise the Stock Location of the Warehouse self.location_id = self.warehouse_id.lot_stock_id.id