Commit 78df4788 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_accounting: Use same earlier start date when generate Aggregated Sale Packing List

parent 154faba8
...@@ -84,8 +84,8 @@ for movement in movement_list: ...@@ -84,8 +84,8 @@ for movement in movement_list:
if subscription is not None: if subscription is not None:
temp_movement.edit( temp_movement.edit(
specialise=specialise_to_set, specialise=specialise_to_set,
causality=subscription) causality=subscription,
start_date=movement.getStartDate())
elif movement.getCausality(portal_type="Subscription Request") is not None: elif movement.getCausality(portal_type="Subscription Request") is not None:
temp_movement.edit( temp_movement.edit(
specialise=specialise_to_set, specialise=specialise_to_set,
......
...@@ -33,11 +33,19 @@ input_movement_list = [restrictedTraverse(q) for q in ...@@ -33,11 +33,19 @@ input_movement_list = [restrictedTraverse(q) for q in
if restrictedTraverse(q).getDestination() == person and \ if restrictedTraverse(q).getDestination() == person and \
restrictedTraverse(q).getSpecialise() in specialise_filter_list] restrictedTraverse(q).getSpecialise() in specialise_filter_list]
min_start_date = None
for delivery_line in input_movement_list: for delivery_line in input_movement_list:
delivery_line.setGroupingReference(reference) delivery_line.setGroupingReference(reference)
if min_start_date is None:
min_start_date = delivery_line.getStartDate()
elif delivery_line.getStartDate() < min_start_date:
min_start_date = delivery_line.getStartDate()
if context.getCausalityState() == 'draft': if context.getCausalityState() == 'draft':
context.startBuilding() context.startBuilding()
if context.getStartDate() is None: if context.getStartDate() is None:
context.setStartDate(DateTime().earliestTime()) if min_start_date is None:
min_start_date = DateTime().earliestTime()
context.setStartDate(min_start_date)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment