Commit 5d8d4b90 authored by Rafael Monnerat's avatar Rafael Monnerat

Use Trade Condition from Configurator (if available)

Use sale trade condition from configurator or create a very
similar one. Do not use path to this in order to prevent
this business template depends on others bt5s.
parent f6bb7200
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Sale Trade Condition" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_identity_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_range_criterion</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>specialise/business_process_module/erp5_default_business_process</string>
<string>price_currency/currency_module/1</string>
</tuple>
</value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>default-sale-order-trade-condition</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>1</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Sale Trade Condition</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Default Sale Order Trade Condition</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value>
<none/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -62,22 +62,17 @@ for account in context.account_module.objectValues():\n ...@@ -62,22 +62,17 @@ for account in context.account_module.objectValues():\n
if isTransitionPossible(account, \'validate\'):\n if isTransitionPossible(account, \'validate\'):\n
account.validate()\n account.validate()\n
\n \n
# validate default business process\n
business_process = context.portal_catalog.getResultValue(portal_type=\'Business Process\',\n business_process = context.portal_catalog.getResultValue(portal_type=\'Business Process\',\n
reference=\'erp5_default_business_process\')\n reference=\'erp5_default_business_process\')\n
business_process.account_debit_path.setTestTalesExpression(\'python: True\')\n
business_process.account_credit_path.setTestTalesExpression(\'python: True\')\n
business_process.account_debit_path.setSourceValue(context.account_module.goods_sales)\n
business_process.account_credit_path.setSourceValue(context.account_module.receivable)\n
\n
if isTransitionPossible(business_process, \'validate\'):\n
business_process.validate()\n
\n \n
# add default sale order trade condition\n # validate default business process\n
sale_order_trade_condition = context.portal_catalog.getResultValue(portal_type=\'Sale Trade Condition\',\n if context.portal_templates.getInstalledBusinessTemplate("erp5_simulation_test") is not None:\n
reference=\'default-sale-order-trade-condition\')\n business_process.account_debit_path.setTestTalesExpression(\'python: True\')\n
if isTransitionPossible(sale_order_trade_condition, \'validate\'):\n business_process.account_debit_path.setSourceValue(context.account_module.goods_sales)\n
sale_order_trade_condition.validate()\n business_process.account_credit_path.setTestTalesExpression(\'python: True\')\n
business_process.account_credit_path.setSourceValue(context.account_module.receivable)\n
if isTransitionPossible(business_process, \'validate\'):\n
business_process.validate()\n
\n \n
# check if there is already the euro curency on the instance\n # check if there is already the euro curency on the instance\n
currency = context.portal_catalog.getResultValue(portal_type=\'Currency\',\n currency = context.portal_catalog.getResultValue(portal_type=\'Currency\',\n
...@@ -91,6 +86,22 @@ if currency is None:\n ...@@ -91,6 +86,22 @@ if currency is None:\n
if isTransitionPossible(currency, \'validate\'):\n if isTransitionPossible(currency, \'validate\'):\n
currency.validate()\n currency.validate()\n
\n \n
\n
# add default sale order trade condition\n
sale_order_trade_condition = context.portal_catalog.getResultValue(portal_type=\'Sale Trade Condition\',\n
reference=\'STC-General\')\n
if sale_order_trade_condition is None:\n
sale_order_trade_condition = context.sale_trade_condition_module.newContent(\n
portal_type=\'Sale Trade Condition\',\n
reference=\'STC-General\',\n
title=\'General Sale Trade Condition\',\n
price_currency=currency.getRelativeUrl())\n
sale_order_trade_condition.setSpecialiseValue(business_process)\n
\n
if isTransitionPossible(sale_order_trade_condition, \'validate\'):\n
sale_order_trade_condition.validate()\n
\n
\n
product = portal.product_module.newContent(portal_type=\'Product\',\n product = portal.product_module.newContent(portal_type=\'Product\',\n
title=howto_dict[\'sale_howto_product_title\'])\n title=howto_dict[\'sale_howto_product_title\'])\n
product.setSupplyLinePriceCurrency(currency.getRelativeUrl()) \n product.setSupplyLinePriceCurrency(currency.getRelativeUrl()) \n
......
...@@ -21,5 +21,3 @@ portal_categories/role/** ...@@ -21,5 +21,3 @@ portal_categories/role/**
portal_categories/use/test_functional_incoming_service portal_categories/use/test_functional_incoming_service
portal_tests/user_tutorial_zuite portal_tests/user_tutorial_zuite
portal_tests/user_tutorial_zuite/** portal_tests/user_tutorial_zuite/**
sale_trade_condition_module/1
sale_trade_condition_module/1/**
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