diff --git a/product/ERP5Configurator/Document/PurchaseTradeConditionConfiguratorItem.py b/product/ERP5Configurator/Document/PurchaseTradeConditionConfiguratorItem.py index 24b58604b9e7284200adde9d063a49af9bb4d268..76fe00934fe16776e715ed97bd8da13b4fd26745 100644 --- a/product/ERP5Configurator/Document/PurchaseTradeConditionConfiguratorItem.py +++ b/product/ERP5Configurator/Document/PurchaseTradeConditionConfiguratorItem.py @@ -28,6 +28,7 @@ import zope.interface from AccessControl import ClassSecurityInfo +from DateTime import DateTime from Products.ERP5Type import Permissions, PropertySheet, interfaces from Products.ERP5Type.XMLObject import XMLObject from Products.ERP5Configurator.mixin.configurator_item import ConfiguratorItemMixin @@ -57,11 +58,27 @@ class PurchaseTradeConditionConfiguratorItem(ConfiguratorItemMixin, XMLObject): def build(self, business_configuration): portal = self.getPortalObject() + business_process_id = \ + business_configuration.getGlobalConfigurationAttr('business_process_id') + + organisation_id = \ + business_configuration.getGlobalConfigurationAttr('organisation_id') + + currency_id = \ + business_configuration.getGlobalConfigurationAttr('currency_id') + purchase_trade_condition = portal.purchase_trade_condition_module.netContent( portal_type="Purchase Trade Condition", referece=self.getReference(), - title=self.getTitle()) + title=self.getTitle(), + effective_date=DateTime() - 1, + expiration_date=DateTime() + 10 * 365) + + purchase_trade_condition.setSpecialise("business_process_module/%s" %\ + business_process_id) - ### XXX Create Business Paths and Business Links + purchase_trade_condition.setDestination("organisation_module/%s" % organisation_id) + purchase_trade_condition.setDestinationSection("organisation_module/%s" % organisation_id) + purchase_trade_condition.setPriceCurrency("currency_module/%s" % currency_id) self.install(purchase_trade_condition, business_configuration)