From 74936dbb6409e2301cfdc1d49d13d2dbeed8b411 Mon Sep 17 00:00:00 2001 From: Ravi Patel Date: Fri, 13 May 2016 17:51:13 +0530 Subject: [PATCH] [IMP] stock: Use default dest location of picking types on return transfers Purpose: When we create a return transfer, the return location should be selected as the default destination location of the "Picking type for return". Odoo should be using that return location as the default return location during reverse transfer, but only if the default destination location of the "Picking type for return" is a return location Specification: For all transfers, if the default destination location of the "Picking type for return" is a return location, then the return location should be selected as the default destination location during reverse transfer. --- addons/stock/wizard/stock_picking_return.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/stock/wizard/stock_picking_return.py b/addons/stock/wizard/stock_picking_return.py index 0196903910b..370006aedc0 100644 --- a/addons/stock/wizard/stock_picking_return.py +++ b/addons/stock/wizard/stock_picking_return.py @@ -67,7 +67,10 @@ class ReturnPicking(models.TransientModel): if 'original_location_id' in fields: res.update({'original_location_id': picking.location_id.id}) if 'location_id' in fields: - res.update({'location_id': picking.location_id.id}) + location_id = picking.location_id.id + if picking.picking_type_id.return_picking_type_id.default_location_dest_id.return_location: + location_id = picking.picking_type_id.return_picking_type_id.default_location_dest_id.id + res['location_id'] = location_id return res @api.multi