mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
@@ -77,7 +77,17 @@ class StockReservation(models.Model):
|
||||
# If picking_type_id is present and location_id is not, try to find
|
||||
# default value for location_id
|
||||
if not res.get("picking_type_id", None):
|
||||
res["picking_type_id"] = self._default_picking_type_id()
|
||||
res["picking_type_id"] = (
|
||||
self.env["stock.picking.type"]
|
||||
.search(
|
||||
[
|
||||
("code", "=", "outgoing"),
|
||||
("company_id", "=", res.get("company_id")),
|
||||
],
|
||||
limit=1,
|
||||
)
|
||||
.id
|
||||
)
|
||||
|
||||
picking_type_id = res.get("picking_type_id")
|
||||
if picking_type_id and not res.get("location_id", False):
|
||||
@@ -105,11 +115,6 @@ class StockReservation(models.Model):
|
||||
location_id = False
|
||||
return location_id
|
||||
|
||||
@api.model
|
||||
def _default_picking_type_id(self):
|
||||
ref = "stock.picking_type_out"
|
||||
return self.env.ref(ref, raise_if_not_found=False).id
|
||||
|
||||
@api.model
|
||||
def _default_location_dest_id(self):
|
||||
ref = "stock_reserve.stock_location_reservation"
|
||||
|
||||
Reference in New Issue
Block a user