Commit 94745c0b authored by Łukasz Nowak's avatar Łukasz Nowak

Migrate Open Sale Order correctly.

parent 0bac090b
...@@ -25,6 +25,17 @@ def DeliveryLineSetZeroPriceAndOrUpdateAppliedRule(self): ...@@ -25,6 +25,17 @@ def DeliveryLineSetZeroPriceAndOrUpdateAppliedRule(self):
from DateTime import DateTime from DateTime import DateTime
@WorkflowMethod.disable @WorkflowMethod.disable
def OpenSaleOrderLine_migrate(self): def OpenSaleOrderLine_migrate(self):
open_sale_order = self.getParentValue()
if open_sale_order.getSpecialise() != 'sale_trade_condition_module/vifib_simple_trade_condition':
open_sale_order.setSpecialise('sale_trade_condition_module/vifib_simple_trade_condition')
if open_sale_order.getDestinationDecision() != open_sale_order.getDestination():
open_sale_order.setDestinationDecision(open_sale_order.getDestination())
if open_sale_order.getSource() != 'organisation_module/vifib_internet':
open_sale_order.setSource('organisation_module/vifib_internet')
if open_sale_order.getSourceSection() != 'organisation_module/vifib_internet':
open_sale_order.setSourceSection('organisation_module/vifib_internet')
if open_sale_order.getPriceCurrency() != 'currency_module/EUR':
open_sale_order.setPriceCurrency('currency_module/EUR')
now = DateTime().earliestTime() now = DateTime().earliestTime()
self.setStartDate(now) self.setStartDate(now)
self.setStopDate(now) self.setStopDate(now)
...@@ -35,13 +46,6 @@ def OpenSaleOrderLine_migrate(self): ...@@ -35,13 +46,6 @@ def OpenSaleOrderLine_migrate(self):
self.setBaseContributionList(resource_value.getBaseContributionList()) self.setBaseContributionList(resource_value.getBaseContributionList())
self.setUseList(resource_value.getUseList()) self.setUseList(resource_value.getUseList())
self.setQuantityUnit(resource_value.getQuantityUnit()) self.setQuantityUnit(resource_value.getQuantityUnit())
self.setSpecialise('sale_trade_condition_module/vifib_simple_trade_condition')
self.setSourceSection('organisation_module/vifib_internet')
self.setSource('organisation_module/vifib_internet')
self.setDestination(self.getParentValue().getDestinationSection())
self.setDestinationSection(self.getParentValue().getDestinationSection())
self.setDestinationDecision(self.getParentValue().getDestinationDecision())
self.setPriceCurrency('currency_module/EUR')
@WorkflowMethod.disable @WorkflowMethod.disable
def VifibSaleInvoiceBuilder_buildAndPlan(self, movement_list): def VifibSaleInvoiceBuilder_buildAndPlan(self, movement_list):
......
69 70
\ 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