Support product location also for customer return shipment

review677002
This commit is contained in:
Cédric Krier
2013-03-05 10:35:19 +01:00
parent c984374047
commit e1374602ee
2 changed files with 15 additions and 1 deletions
+1
View File
@@ -11,4 +11,5 @@ def register():
Product,
ProductLocation,
ShipmentIn,
ShipmentOutReturn,
module='stock_product_location', type_='model')
+14 -1
View File
@@ -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