Commit 93ca7989 authored by Rafael Monnerat's avatar Rafael Monnerat

Minor changes and code reorganisation.

parent ee8da024
...@@ -42,6 +42,12 @@ ...@@ -42,6 +42,12 @@
<key> <string>type_class</string> </key> <key> <string>type_class</string> </key>
<value> <string>RuleConfiguratorItem</string> </value> <value> <string>RuleConfiguratorItem</string> </value>
</item> </item>
<item>
<key> <string>type_interface</string> </key>
<value>
<tuple/>
</value>
</item>
<item> <item>
<key> <string>type_mixin</string> </key> <key> <string>type_mixin</string> </key>
<value> <value>
......
...@@ -89,27 +89,21 @@ configuration_save.addConfigurationItem("Catalog Keyword Key Configurator Item", ...@@ -89,27 +89,21 @@ configuration_save.addConfigurationItem("Catalog Keyword Key Configurator Item",
# site_property_list=[[[\'email_from_address\', \'email@example.com\', \'string\'],]])\n # site_property_list=[[[\'email_from_address\', \'email@example.com\', \'string\'],]])\n
\n \n
# Customize portal type information.\n # Customize portal type information.\n
configuration_save.addConfigurationItem("Portal Type Configurator Item",\n # Include Constraints to some Simulation Objects\n
target_portal_type=\'Purchase Order\',\n # XXX (rafael) Why not Purchase Packing List?\n
add_propertysheet_list=(\'TradeOrder\',))\n for portal_type in [\'Purchase Order\', \'Sale Order\',\'Sale Packing List\']:\n
configuration_save.addConfigurationItem("Portal Type Configurator Item",\n configuration_save.addConfigurationItem("Portal Type Configurator Item",\n
target_portal_type=\'Sale Order\',\n target_portal_type=portal_type,\n
add_propertysheet_list=(\'TradeOrder\',))\n add_propertysheet_list=(\'TradeOrder\',))\n
configuration_save.addConfigurationItem("Portal Type Configurator Item",\n \n
target_portal_type=\'Purchase Order Line\',\n for portal_type in [\'Purchase Order Line\', \'Sale Order Line\',\'Sale Packing List Line\']:\n
add_propertysheet_list=(\'TradeOrderLine\',))\n configuration_save.addConfigurationItem("Portal Type Configurator Item",\n
configuration_save.addConfigurationItem("Portal Type Configurator Item",\n target_portal_type=portal_type,\n
target_portal_type=\'Sale Order Line\',\n
add_propertysheet_list=(\'TradeOrderLine\',))\n add_propertysheet_list=(\'TradeOrderLine\',))\n
\n
configuration_save.addConfigurationItem("Portal Type Configurator Item",\n configuration_save.addConfigurationItem("Portal Type Configurator Item",\n
target_portal_type=\'Inventory\',\n target_portal_type=\'Inventory\',\n
add_propertysheet_list=(\'InventoryConstraint\',))\n add_propertysheet_list=(\'InventoryConstraint\',))\n
configuration_save.addConfigurationItem("Portal Type Configurator Item",\n
target_portal_type=\'Sale Packing List\',\n
add_propertysheet_list=(\'TradeOrder\',))\n
configuration_save.addConfigurationItem("Portal Type Configurator Item",\n
target_portal_type=\'Sale Packing List Line\',\n
add_propertysheet_list=(\'TradeOrderLine\',))\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
......
...@@ -60,7 +60,7 @@ class PurchaseTradeConditionConfiguratorItem(ConfiguratorItemMixin, XMLObject): ...@@ -60,7 +60,7 @@ class PurchaseTradeConditionConfiguratorItem(ConfiguratorItemMixin, XMLObject):
def _build(self, business_configuration): def _build(self, business_configuration):
portal = self.getPortalObject() portal = self.getPortalObject()
business_process_id = \ business_process_id = \
business_configuration.getGlobalConfigurationAttr('business_process_id') business_configuration.getGlobalConfigurationAttr('business_process_id')
organisation_id = \ organisation_id = \
business_configuration.getGlobalConfigurationAttr('organisation_id') business_configuration.getGlobalConfigurationAttr('organisation_id')
...@@ -68,20 +68,20 @@ class PurchaseTradeConditionConfiguratorItem(ConfiguratorItemMixin, XMLObject): ...@@ -68,20 +68,20 @@ class PurchaseTradeConditionConfiguratorItem(ConfiguratorItemMixin, XMLObject):
currency_id = \ currency_id = \
business_configuration.getGlobalConfigurationAttr('currency_id') business_configuration.getGlobalConfigurationAttr('currency_id')
purchase_trade_condition = portal.purchase_trade_condition_module.newContent( trade_condition = portal.purchase_trade_condition_module.newContent(
portal_type="Purchase Trade Condition", portal_type="Purchase Trade Condition",
reference=self.getReference(), reference=self.getReference(),
title=self.getTitle(), title=self.getTitle(),
effective_date=DateTime() - 1, effective_date=DateTime() - 1,
expiration_date=DateTime() + 10 * 365) expiration_date=DateTime() + 10 * 365)
purchase_trade_condition.setSpecialise("business_process_module/%s" %\ trade_condition.setSpecialise("business_process_module/%s" %\
business_process_id) business_process_id)
purchase_trade_condition.setDestination("organisation_module/%s" % organisation_id) trade_condition.setDestination("organisation_module/%s" % organisation_id)
purchase_trade_condition.setDestinationSection("organisation_module/%s" % organisation_id) trade_condition.setDestinationSection("organisation_module/%s" % organisation_id)
purchase_trade_condition.setPriceCurrency("currency_module/%s" % currency_id) trade_condition.setPriceCurrency("currency_module/%s" % currency_id)
purchase_trade_condition.validate(comment="Validated by Configurator") trade_condition.validate(comment="Validated by Configurator")
self.install(purchase_trade_condition, business_configuration) self.install(trade_condition, business_configuration)
...@@ -60,7 +60,7 @@ class SaleTradeConditionConfiguratorItem(ConfiguratorItemMixin, XMLObject): ...@@ -60,7 +60,7 @@ class SaleTradeConditionConfiguratorItem(ConfiguratorItemMixin, XMLObject):
def _build(self, business_configuration): def _build(self, business_configuration):
portal = self.getPortalObject() portal = self.getPortalObject()
business_process_id = \ business_process_id = \
business_configuration.getGlobalConfigurationAttr('business_process_id') business_configuration.getGlobalConfigurationAttr('business_process_id')
organisation_id = \ organisation_id = \
business_configuration.getGlobalConfigurationAttr('organisation_id') business_configuration.getGlobalConfigurationAttr('organisation_id')
...@@ -68,20 +68,20 @@ class SaleTradeConditionConfiguratorItem(ConfiguratorItemMixin, XMLObject): ...@@ -68,20 +68,20 @@ class SaleTradeConditionConfiguratorItem(ConfiguratorItemMixin, XMLObject):
currency_id = \ currency_id = \
business_configuration.getGlobalConfigurationAttr('currency_id') business_configuration.getGlobalConfigurationAttr('currency_id')
sale_trade_condition = portal.sale_trade_condition_module.newContent( trade_condition = portal.sale_trade_condition_module.newContent(
portal_type="Sale Trade Condition", portal_type="Sale Trade Condition",
reference=self.getReference(), reference=self.getReference(),
title=self.getTitle(), title=self.getTitle(),
effective_date=DateTime() - 1, effective_date=DateTime() - 1,
expiration_date=DateTime() + 10 * 365) expiration_date=DateTime() + 10 * 365)
sale_trade_condition.setSpecialise("business_process_module/%s" %\ trade_condition.setSpecialise("business_process_module/%s" %\
business_process_id) business_process_id)
sale_trade_condition.setSource("organisation_module/%s" % organisation_id) trade_condition.setSource("organisation_module/%s" % organisation_id)
sale_trade_condition.setSourceSection("organisation_module/%s" % organisation_id) trade_condition.setSourceSection("organisation_module/%s" % organisation_id)
sale_trade_condition.setPriceCurrency("currency_module/%s" % currency_id) trade_condition.setPriceCurrency("currency_module/%s" % currency_id)
sale_trade_condition.validate(comment="Validated by Configurator") trade_condition.validate(comment="Validated by Configurator")
self.install(sale_trade_condition, business_configuration) self.install(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