From 648776327c9717c23e12d84ab79cbc29247b0624 Mon Sep 17 00:00:00 2001 From: Patrick Wilson <36892066+patrickrwilson@users.noreply.github.com> Date: Wed, 1 Apr 2020 16:43:24 -0500 Subject: [PATCH] [IMP] Add warehouse_id to existing onchange. --- stock_request_direction/models/stock_request_order.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/stock_request_direction/models/stock_request_order.py b/stock_request_direction/models/stock_request_order.py index f1b970180..3e5cd274b 100644 --- a/stock_request_direction/models/stock_request_order.py +++ b/stock_request_direction/models/stock_request_order.py @@ -14,7 +14,7 @@ class StockRequestOrder(models.Model): readonly=True, ) - @api.onchange("direction") + @api.onchange("warehouse_id", "direction") def _onchange_location_id(self): if self.direction == "outbound": # Stock Location set to Partner Locations/Customers @@ -22,11 +22,6 @@ class StockRequestOrder(models.Model): else: # Otherwise the Stock Location of the Warehouse self.location_id = self.warehouse_id.lot_stock_id.id - - @api.onchange('warehouse_id') - def _onchange_warehouse_id(self): - if self.direction: - self.direction = False for stock_request in self.stock_request_ids: if stock_request.route_id: stock_request.route_id = False