Commit 01012b81 authored by Łukasz Nowak's avatar Łukasz Nowak

Set specialise in more steps.

First stabilise orders.
Then during linking update linked packing list
Lastly while playing with non linked packing list set correct specialise.
parent a7d2138a
...@@ -51,14 +51,11 @@ ...@@ -51,14 +51,11 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>portal_type = context.getPortalType()\n <value> <string>portal_type = context.getPortalType()\n
assert( portal_type in context.getPortalDeliveryMovementTypeList() + (\'Sale Order Line\',) )\n assert( portal_type in context.getPortalDeliveryMovementTypeList())\n
common_specialise = \'sale_trade_condition_module/vifib_trade_condition\'\n common_specialise = \'sale_trade_condition_module/vifib_trade_condition\'\n
specialise = context.getParentValue().getSpecialise()\n specialise = context.getParentValue().getSpecialise()\n
if common_specialise != specialise:\n if common_specialise != specialise:\n
context.getParentValue().setSpecialise(common_specialise)\n context.getParentValue().setSpecialise(common_specialise)\n
if portal_type == \'Sale Order Line\':\n
# nothing else to do\n
return\n
context.setPrice(0.0)\n context.setPrice(0.0)\n
if context.getSimulationState() == \'cancelled\':\n if context.getSimulationState() == \'cancelled\':\n
# force no simulation\n # force no simulation\n
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>context.getPortalObject().portal_catalog.searchAndActivate(\n <value> <string>context.getPortalObject().portal_catalog.searchAndActivate(\n
portal_type=context.getPortalDeliveryMovementTypeList() + (\'Sale Order Line\',),\n portal_type=context.getPortalDeliveryMovementTypeList(),\n
method_id=\'DeliveryLineSetZeroPriceAndOrUpdateAppliedRule\'\n method_id=\'DeliveryLineSetZeroPriceAndOrUpdateAppliedRule\'\n
)\n )\n
</string> </value> </string> </value>
......
...@@ -72,6 +72,11 @@ if delivery_simulation.getDelivery() == packing_list_line:\n ...@@ -72,6 +72,11 @@ if delivery_simulation.getDelivery() == packing_list_line:\n
return\n return\n
assert(delivery_simulation.getDelivery() is None)\n assert(delivery_simulation.getDelivery() is None)\n
delivery_simulation.setDelivery(packing_list_line)\n delivery_simulation.setDelivery(packing_list_line)\n
delivery = packing_list_line.getParentValue()\n
common_specialise = \'sale_trade_condition_module/vifib_trade_condition\'\n
specialise = delivery.getSpecialise()\n
if common_specialise != specialise:\n
delivery.setSpecialise(common_specialise)\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
......
...@@ -54,6 +54,10 @@ ...@@ -54,6 +54,10 @@
raise ValueError(\'%s is not sale order line\' % context.getPath())\n raise ValueError(\'%s is not sale order line\' % context.getPath())\n
context.setPrice(0.0)\n context.setPrice(0.0)\n
context.setQuantity(1.0)\n context.setQuantity(1.0)\n
common_specialise = \'sale_trade_condition_module/vifib_trade_condition\'\n
specialise = context.getParentValue().getSpecialise()\n
if common_specialise != specialise:\n
context.getParentValue().setSpecialise(common_specialise)\n
context.getParentValue().Delivery_updateAppliedRule()\n context.getParentValue().Delivery_updateAppliedRule()\n
</string> </value> </string> </value>
</item> </item>
......
37 38
\ 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