Support product location also for customer return shipment
review677002
This commit is contained in:
@@ -11,4 +11,5 @@ def register():
|
||||
Product,
|
||||
ProductLocation,
|
||||
ShipmentIn,
|
||||
ShipmentOutReturn,
|
||||
module='stock_product_location', type_='model')
|
||||
|
||||
+14
-1
@@ -6,7 +6,7 @@ from trytond.transaction import Transaction
|
||||
from trytond.backend import TableHandler
|
||||
from trytond.pool import PoolMeta
|
||||
|
||||
__all__ = ['ProductLocation', 'ShipmentIn']
|
||||
__all__ = ['ProductLocation', 'ShipmentIn', 'ShipmentOutReturn']
|
||||
__metaclass__ = PoolMeta
|
||||
|
||||
|
||||
@@ -58,3 +58,16 @@ class ShipmentIn:
|
||||
continue
|
||||
res['to_location'] = product_location.location.id
|
||||
return res
|
||||
|
||||
|
||||
class ShipmentOutReturn:
|
||||
__name__ = 'stock.shipment.out.return'
|
||||
|
||||
@classmethod
|
||||
def _get_inventory_moves(cls, incoming_move):
|
||||
res = super(ShipmentOutReturn, cls)._get_inventory_moves(incoming_move)
|
||||
for product_location in incoming_move.product.locations:
|
||||
if (product_location.warehouse
|
||||
== incoming_move.shipment_out_return.warehouse):
|
||||
res['to_location'] = product_location.location.id
|
||||
return res
|
||||
|
||||
Reference in New Issue
Block a user