Commit fd12be27 authored by Sebastien Robin's avatar Sebastien Robin

- allow to override an init script for Currency Exchange Line

- modify CurrencyExchange_getExchangeRateList in order to
  retrieve default price value defined on the line instead of only
  looking to cells.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@15161 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 2c0f5089
...@@ -3,11 +3,8 @@ ...@@ -3,11 +3,8 @@
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<tuple> <tuple>
<tuple> <global name="ERP5TypeInformation" module="Products.ERP5Type.ERP5Type"/>
<string>Products.ERP5Type.ERP5Type</string> <tuple/>
<string>ERP5TypeInformation</string>
</tuple>
<none/>
</tuple> </tuple>
</pickle> </pickle>
<pickle> <pickle>
...@@ -42,6 +39,10 @@ ...@@ -42,6 +39,10 @@
<list/> <list/>
</value> </value>
</item> </item>
<item>
<key> <string>acquire_local_roles</string> </key>
<value> <int>1</int> </value>
</item>
<item> <item>
<key> <string>allowed_content_types</string> </key> <key> <string>allowed_content_types</string> </key>
<value> <value>
...@@ -79,6 +80,12 @@ ...@@ -79,6 +80,12 @@
<key> <string>filter_content_types</string> </key> <key> <string>filter_content_types</string> </key>
<value> <int>1</int> </value> <value> <int>1</int> </value>
</item> </item>
<item>
<key> <string>group_list</string> </key>
<value>
<tuple/>
</value>
</item>
<item> <item>
<key> <string>hidden_content_type_list</string> </key> <key> <string>hidden_content_type_list</string> </key>
<value> <value>
...@@ -91,6 +98,10 @@ ...@@ -91,6 +98,10 @@
</item> </item>
<item> <item>
<key> <string>init_script</string> </key> <key> <string>init_script</string> </key>
<value> <string>CurrencyExchangeLine_init</string> </value>
</item>
<item>
<key> <string>permission</string> </key>
<value> <string></string> </value> <value> <string></string> </value>
</item> </item>
<item> <item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Python_magic</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>__ac_local_roles__</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string># Allow to override the script in order to do specific stuff\n
pass\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_filepath</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>**kw</string> </value>
</item>
<item>
<key> <string>errors</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>func_code</string> </key>
<value>
<object>
<klass>
<global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>co_argcount</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>kw</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>CurrencyExchangeLine_init</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -3,11 +3,8 @@ ...@@ -3,11 +3,8 @@
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<tuple> <tuple>
<tuple> <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
<string>Products.PythonScripts.PythonScript</string> <tuple/>
<string>PythonScript</string>
</tuple>
<none/>
</tuple> </tuple>
</pickle> </pickle>
<pickle> <pickle>
...@@ -137,8 +134,16 @@ else:\n ...@@ -137,8 +134,16 @@ else:\n
has_cell_content=0, \n has_cell_content=0, \n
validation_state=\'validated\',\n validation_state=\'validated\',\n
sort_method=sort_by_date)\n sort_method=sort_by_date)\n
result = [getattr(mapped_value, \'base_price\', None), \n base_price = getattr(mapped_value, \'base_price\', None)\n
getattr(mapped_value, \'discount\', None)]\n discount = getattr(mapped_value, \'discount\', None)\n
if base_price is None and discount is None:\n
mapped_value = context.portal_domains.generateMappedValue(object, \n
has_cell_content=1, \n
validation_state=\'validated\',\n
sort_method=sort_by_date) \n
base_price = getattr(mapped_value, \'base_price\', None)\n
discount = getattr(mapped_value, \'discount\', None)\n
result = [base_price, discount]\n
return result\n return result\n
...@@ -211,6 +216,8 @@ return result\n ...@@ -211,6 +216,8 @@ return result\n
<string>result</string> <string>result</string>
<string>getattr</string> <string>getattr</string>
<string>mapped_value</string> <string>mapped_value</string>
<string>base_price</string>
<string>discount</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
126 129
\ No newline at end of file \ No newline at end of file
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