mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
[IMP] Add warehouse_id to existing onchange.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user