Implement task.

This commit refs #906
This commit is contained in:
Sergio Morillo 2016-01-07 18:57:44 +01:00
parent 317d561de5
commit 04b284f391
2 changed files with 7 additions and 3 deletions

View File

@ -129,7 +129,8 @@ class LoadOrder:
for item in grouped_items:
new_moves = item._get_new_moves({'from_location': sale_line.from_location.id,
'to_location': sale_line.to_location.id,
'date_time_': self.end_date})
'start_date': self.start_date,
'end_date': self.end_date})
move, = [m for m in new_moves if m.product == item.product]
move.origin = sale_line
moves.append(move)
@ -173,7 +174,8 @@ class LoadOrder:
product=move.product,
uom=move.uom,
quantity=move.quantity,
date_time_=self.start_date,
start_date=self.start_date,
end_date=self.end_date,
company=move.company,
currency=move.currency,
unit_price=move.unit_price,

View File

@ -373,7 +373,9 @@ Check sale::
u'Plastic Case 30x30'
>>> order.inventory_moves[0].quantity
2.0
>>> order.inventory_moves[0].date_time_ == order.start_date
>>> order.inventory_moves[0].start_date == order.start_date
True
>>> order.inventory_moves[0].end_date == order.end_date
True
>>> len(order.outgoing_moves)
1