Commit 98d6ebb5 authored by Łukasz Nowak's avatar Łukasz Nowak

Work on aggregated deliveries.

Sale Packing List and Sale Invoice Transaction which are specialised by
getPreferredAggregatedSaleTradeCondition shall be managed in same way.
parent 81405456
......@@ -8,7 +8,7 @@
<dictionary>
<item>
<key> <string>active_sense_method_id</string> </key>
<value> <string>Alarm_deliverConfirmedSaleInvoiceTransaction</string> </value>
<value> <string>Alarm_deliverConfirmedAggregatedDelivery</string> </value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -22,7 +22,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>slapos_deliver_confirmed_sale_invoice_transaction</string> </value>
<value> <string>slapos_deliver_confirmed_aggregated_delivery</string> </value>
</item>
<item>
<key> <string>periodicity_day_frequency</string> </key>
......@@ -89,7 +89,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Deliver confirmed Sale Invoices</string> </value>
<value> <string>Deliver confirmed aggregated deliveries</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -55,10 +55,11 @@ from Products.ERP5Type.DateUtils import getClosestDate\n
\n
portal = context.getPortalObject()\n
portal.portal_catalog.searchAndActivate(\n
portal_type=\'Sale Invoice Transaction\',\n
portal_type=[\'Sale Invoice Transaction\', \'Sale Packing List\'],\n
simulation_state=\'confirmed\',\n
causality_state=\'solved\',\n
method_id=\'SaleInvoiceTransaction_deliverConfirmed\',\n
specialise_uid=portal.restrictedTraverse(portal.portal_preferences.getPreferredAggregatedSaleTradeCondition()).getUid(),\n
method_id=\'Delivery_deliverConfirmedAggregatedDelivery\',\n
activate_kw={\'tag\': tag}\n
)\n
context.activate(after_tag=tag).getId()\n
......@@ -70,7 +71,7 @@ context.activate(after_tag=tag).getId()\n
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Alarm_deliverConfirmedSaleInvoiceTransaction</string> </value>
<value> <string>Alarm_deliverConfirmedAggregatedDelivery</string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -50,7 +50,11 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>isTransitionPossible = context.getPortalObject().portal_workflow.isTransitionPossible\n
<value> <string>portal = context.getPortalObject()\n
if context.getPortalType() not in (\'Sale Packing List\', \'Sale Invoice Transaction\') \\\n
and context.getSpecialise() != portal.portal_preferences.getPreferredAggregatedSaleTradeCondition():\n
raise TypeError(\'Incorrect delivery.\')\n
isTransitionPossible = portal.portal_workflow.isTransitionPossible\n
if context.getSimulationState() == \'confirmed\' and len(context.checkConsistency()) == 0 and context.getCausalityState() == \'solved\':\n
comment = \'Delivered by alarm as all actions in confirmed state are ready.\'\n
if isTransitionPossible(context, \'start\'):\n
......@@ -67,7 +71,7 @@ if context.getSimulationState() == \'confirmed\' and len(context.checkConsistenc
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SaleInvoiceTransaction_deliverConfirmed</string> </value>
<value> <string>Delivery_deliverConfirmedAggregatedDelivery</string> </value>
</item>
</dictionary>
</pickle>
......
154
\ No newline at end of file
155
\ No newline at end of file
......@@ -24,7 +24,7 @@ open_sale_order_module/slapos_accounting_open_sale_order_template
open_sale_order_module/template_open_sale_order
organisation_module/slapos
organisation_module/slapos/bank_account
portal_alarms/slapos_deliver_confirmed_sale_invoice_transaction
portal_alarms/slapos_deliver_confirmed_aggregated_delivery
portal_alarms/slapos_instance_invoicing
portal_alarms/slapos_manage_building_calculating_delivery
portal_alarms/slapos_remove_bogus_delivery_link
......
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