Commit b7b804af authored by Łukasz Nowak's avatar Łukasz Nowak

Set a date on built delivery.

parent 98d6ebb5
...@@ -50,7 +50,8 @@ ...@@ -50,7 +50,8 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>restrictedTraverse = context.getPortalObject().restrictedTraverse\n <value> <string>from DateTime import DateTime\n
restrictedTraverse = context.getPortalObject().restrictedTraverse\n
person = context.getDestination()\n person = context.getDestination()\n
reference = context.getReference()\n reference = context.getReference()\n
input_movement_list = [restrictedTraverse(q) for q in\n input_movement_list = [restrictedTraverse(q) for q in\n
...@@ -62,6 +63,9 @@ for delivery_line in input_movement_list:\n ...@@ -62,6 +63,9 @@ for delivery_line in input_movement_list:\n
delivery_line.setGroupingReference(reference)\n delivery_line.setGroupingReference(reference)\n
if context.getCausalityState() == \'draft\':\n if context.getCausalityState() == \'draft\':\n
context.startBuilding()\n context.startBuilding()\n
\n
if context.getStartDate() is None:\n
context.setStartDate(DateTime().earliestTime())\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
......
...@@ -1301,6 +1301,7 @@ class TestSlapOSAggregatedDeliveryBuilder(testSlapOSMixin): ...@@ -1301,6 +1301,7 @@ class TestSlapOSAggregatedDeliveryBuilder(testSlapOSMixin):
self.assertEqual('building', built_delivery.getCausalityState()) self.assertEqual('building', built_delivery.getCausalityState())
self.assertEqual(delivery.getPriceCurrency(), self.assertEqual(delivery.getPriceCurrency(),
built_delivery.getPriceCurrency()) built_delivery.getPriceCurrency())
self.assertEqual(DateTime().earliestTime(), built_delivery.getStartDate())
delivery_line_list = built_delivery.contentValues( delivery_line_list = built_delivery.contentValues(
portal_type='Sale Packing List Line') portal_type='Sale Packing List Line')
self.assertEqual(1, len(delivery_line_list)) self.assertEqual(1, len(delivery_line_list))
......
155 156
\ No newline at end of file \ No newline at end of file
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