Commit 25e4a08a authored by Jérome Perrin's avatar Jérome Perrin

configurator: allow using different business processes for sale/purchasse

parent 12f5ef1c
......@@ -64,6 +64,7 @@ class AdvancedPurchaseTradeConditionConfiguratorItem(ConfiguratorItemMixin, XMLO
portal = self.getPortalObject()
business_configuration = self.getBusinessConfigurationValue()
business_process_id = \
business_configuration.getGlobalConfigurationAttr('purchase_business_process_id') or\
business_configuration.getGlobalConfigurationAttr('business_process_id')
organisation_id = \
......
......@@ -65,6 +65,7 @@ class AdvancedSaleTradeConditionConfiguratorItem(ConfiguratorItemMixin, XMLObjec
business_configuration = self.getBusinessConfigurationValue()
business_process_id = \
business_configuration.getGlobalConfigurationAttr('sale_business_process_id') or\
business_configuration.getGlobalConfigurationAttr('business_process_id')
organisation_id = \
......
......@@ -71,7 +71,14 @@ class BusinessProcessConfiguratorItem(ConfiguratorItemMixin, XMLObject):
business_configuration = self.getBusinessConfigurationValue()
business_configuration.setGlobalConfigurationAttr(\
business_process_id=business_process.getId())
# XXX for the standard cases, also set configuration attributes that
# Sale/Purchase Configurator Item will use.
if self.getReference() == 'default_erp5_sale_business_process':
business_configuration.setGlobalConfigurationAttr(
sale_business_process_id=business_process.getId())
elif self.getReference() == 'default_erp5_purchase_business_process':
business_configuration.setGlobalConfigurationAttr(
purchase_business_process_id=business_process.getId())
business_process_dict = self._getBusinessProcessDict()
int_index = 0
......
......@@ -36,7 +36,7 @@ from erp5.component.interface.IConfiguratorItem import IConfiguratorItem
class PurchaseTradeConditionConfiguratorItem(ConfiguratorItemMixin, XMLObject):
""" Setup Rules. """
""" Setup Purchase Trade Conditions. """
meta_type = 'ERP5 Purchase Trade Condition Configurator Item'
portal_type = 'Purchase Trade Condition Configurator Item'
......@@ -64,6 +64,7 @@ class PurchaseTradeConditionConfiguratorItem(ConfiguratorItemMixin, XMLObject):
portal = self.getPortalObject()
business_configuration = self.getBusinessConfigurationValue()
business_process_id = \
business_configuration.getGlobalConfigurationAttr('purchase_business_process_id') or\
business_configuration.getGlobalConfigurationAttr('business_process_id')
organisation_id = \
......
......@@ -36,7 +36,7 @@ from erp5.component.interface.IConfiguratorItem import IConfiguratorItem
class SaleTradeConditionConfiguratorItem(ConfiguratorItemMixin, XMLObject):
""" Setup Rules. """
""" Setup Sale Trade Conditions. """
meta_type = 'ERP5 Sale Trade Condition Configurator Item'
portal_type = 'Sale Trade Condition Configurator Item'
......@@ -65,6 +65,7 @@ class SaleTradeConditionConfiguratorItem(ConfiguratorItemMixin, XMLObject):
business_configuration = self.getBusinessConfigurationValue()
business_process_id = \
business_configuration.getGlobalConfigurationAttr('sale_business_process_id') or \
business_configuration.getGlobalConfigurationAttr('business_process_id')
organisation_id = \
......
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