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

Minor changes and code reorganisation.

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