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

Migrate Open Sale Order Lines.

parent 703d682b
......@@ -16,3 +16,22 @@ def DeliveryLineSetZeroPriceAndOrUpdateAppliedRule(self):
else:
self.setQuantity(1.0)
self.Delivery_updateAppliedRule()
from DateTime import DateTime
@WorkflowMethod.disable
def OpenSaleOrderLine_migrate(self):
now = DateTime().earliestTime()
self.setStartDate(now)
self.setStopDate(now)
self.setPrice(0.0)
self.setQuantity(1.0)
self.setResource(self.getPortalObject().portal_preferences.getPreferredInstanceSubscriptionResource())
resource_value = self.getResourceValue()
self.setBaseContributionList(resource_value.getBaseContributionList())
self.setUseList(resource_value.getUseList())
self.setQuantityUnit(resource_value.getQuantityUnit())
self.setSpecialise('sale_trade_condition_module/vifib_trade_condition')
self.setSourceSection('organisation_module/vifib_internet')
self.setSource('organisation_module/vifib_internet')
self.setDestination(self.getParentValue().getDestinationSection())
self.setDestinationSection(self.getParentValue().getDestinationSection())
47
\ No newline at end of file
48
\ 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