Commit 68722dd8 authored by Alain Takoudjou's avatar Alain Takoudjou

slapos_accounting: fix alarm building and calculating delivery.

Add proxy rules Manager to script Delivery_manageBuildingCalculatingDelivery.
Fix condition which check if activity doesn't exists with this path, check if there is no more than one activity running where method is Delivery_manageBuildingCalculatingDelivery and path is current path.
parent a592743a
...@@ -6,6 +6,7 @@ portal.portal_catalog.searchAndActivate( ...@@ -6,6 +6,7 @@ portal.portal_catalog.searchAndActivate(
portal_type=portal.getPortalDeliveryTypeList(), portal_type=portal.getPortalDeliveryTypeList(),
causality_state=('building', 'calculating'), causality_state=('building', 'calculating'),
activate_kw=activate_kw, activate_kw=activate_kw,
packet_size=30,
method_id='Delivery_manageBuildingCalculatingDelivery' method_id='Delivery_manageBuildingCalculatingDelivery'
) )
context.activate(after_tag=tag).getId() context.activate(after_tag=tag).getId()
if REQUEST is not None:
raise Unauthorized
delivery = context delivery = context
if delivery.getCausalityState() not in ('building', 'calculating'): if delivery.getCausalityState() not in ('building', 'calculating'):
return return
path = delivery.getPath() path = delivery.getPath()
portal_activities = context.getPortalObject().portal_activities portal_activities = context.getPortalObject().portal_activities
if portal_activities.countMessage(path=path) == 0 \
if portal_activities.countMessage(method_id='Delivery_manageBuildingCalculatingDelivery', path=path) == 1 \
and portal_activities.countMessageWithTag('%s_solve' % path) == 0: and portal_activities.countMessageWithTag('%s_solve' % path) == 0:
delivery.serialize() delivery.serialize()
delivery.updateCausalityState(solve_automatically=True) delivery.updateCausalityState(solve_automatically=True)
......
...@@ -50,7 +50,15 @@ ...@@ -50,7 +50,15 @@
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string></string> </value> <value> <string>REQUEST=None</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
......
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