[IMP] Add warehouse_id to existing onchange.

This commit is contained in:
Patrick Wilson
2020-04-01 16:43:24 -05:00
parent 96fd02b7f3
commit 8ee00372c7

View File

@@ -13,7 +13,7 @@ class StockRequestOrder(models.Model):
states={'draft': [('readonly', False)]},
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
@@ -23,11 +23,6 @@ class StockRequestOrder(models.Model):
# 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