parent
17fe9febc0
commit
f3a5ee1bce
|
@ -49,7 +49,7 @@ class ShipmentIn(ShipmentCSVMixin, metaclass=PoolMeta):
|
|||
|
||||
@classmethod
|
||||
def _get_csv_key(cls):
|
||||
return ('supplier', 'reference', )
|
||||
return ('supplier', 'reference', 'warehouse', )
|
||||
|
||||
def _set_csv_move_locations(self, move):
|
||||
move.from_location = self.on_change_with_supplier_location()
|
||||
|
|
4
stock.py
4
stock.py
|
@ -121,8 +121,8 @@ class ShipmentCSVMixin(object):
|
|||
csv_file = csv.reader(csv_file, delimiter=csv_delimiter)
|
||||
headers = next(csv_file)
|
||||
unique_key = dict([
|
||||
(d, i) for i, d in enumerate(config_header)
|
||||
if d in cls._get_csv_key()])
|
||||
(d.split('.')[0], i) for i, d in enumerate(config_header)
|
||||
if d.split('.')[0] in cls._get_csv_key()])
|
||||
|
||||
data = OrderedDict()
|
||||
assert len(headers) == len(config_header)
|
||||
|
|
|
@ -137,8 +137,12 @@ CSV import shipment in wizard::
|
|||
>>> csv_import.execute('import_')
|
||||
>>> shipment_in.reload()
|
||||
>>> len(shipment_in.moves)
|
||||
1
|
||||
>>> shipments = ShipmentIn.find([])
|
||||
>>> len(shipments)
|
||||
2
|
||||
>>> shipment_in.moves[0].to_location == wh2.input_location
|
||||
>>> new_shipment = sorted(shipments, key=lambda s: s.id)[-1]
|
||||
>>> new_shipment.moves[0].to_location == wh2.input_location
|
||||
True
|
||||
|
||||
When location cross reference does not exist::
|
||||
|
|
Loading…
Reference in New Issue