Commit 0cd70dc5 authored by Rafael Monnerat's avatar Rafael Monnerat

Implement Purchase Trade Condition.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@44915 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 6823104e
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
import zope.interface import zope.interface
from AccessControl import ClassSecurityInfo from AccessControl import ClassSecurityInfo
from DateTime import DateTime
from Products.ERP5Type import Permissions, PropertySheet, interfaces from Products.ERP5Type import Permissions, PropertySheet, interfaces
from Products.ERP5Type.XMLObject import XMLObject from Products.ERP5Type.XMLObject import XMLObject
from Products.ERP5Configurator.mixin.configurator_item import ConfiguratorItemMixin from Products.ERP5Configurator.mixin.configurator_item import ConfiguratorItemMixin
...@@ -57,11 +58,27 @@ class PurchaseTradeConditionConfiguratorItem(ConfiguratorItemMixin, XMLObject): ...@@ -57,11 +58,27 @@ class PurchaseTradeConditionConfiguratorItem(ConfiguratorItemMixin, XMLObject):
def build(self, business_configuration): def build(self, business_configuration):
portal = self.getPortalObject() 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( purchase_trade_condition = portal.purchase_trade_condition_module.netContent(
portal_type="Purchase Trade Condition", portal_type="Purchase Trade Condition",
referece=self.getReference(), 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) self.install(purchase_trade_condition, business_configuration)
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