Commit 65007973 authored by Mame Coumba Sall's avatar Mame Coumba Sall

2008-09-10

* Add CurrencyExchangeLine_view form with proxy fiels
* Took care of case where getPrice is called directly on the resource

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@23544 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c92f7c4b
...@@ -90,7 +90,6 @@ ...@@ -90,7 +90,6 @@
<list> <list>
<string>my_start_date</string> <string>my_start_date</string>
<string>my_stop_date</string> <string>my_stop_date</string>
<string>my_translated_validation_state_title</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -99,6 +98,7 @@ ...@@ -99,6 +98,7 @@
<value> <value>
<list> <list>
<string>listbox_base_price</string> <string>listbox_base_price</string>
<string>listbox_discount</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -117,6 +117,7 @@ ...@@ -117,6 +117,7 @@
<list> <list>
<string>my_source_title</string> <string>my_source_title</string>
<string>my_base_price</string> <string>my_base_price</string>
<string>my_translated_validation_state_title</string>
</list> </list>
</value> </value>
</item> </item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>listbox_discount</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_money_quantity</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Discount</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -65,15 +65,26 @@ ...@@ -65,15 +65,26 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>"Search for all predicates that corresponds to this particular context"\n <value> <string>"""\n
predicate_list = context.portal_domains.searchPredicateList(\n Search for all predicates that corresponds to this particular context\n
context=movement,portal_type=\'Currency Exchange Line\')\n and returns the base price of the resource\n
This script derives form getPriceCalculationOperandDict and is invoked by getPrice.\n
\n
movement -- transaction line\n
\n
**kw -- dictionary containing all information of the transaction\n
\n \n
"""\n """\n
For each predicate(i.e: Currency Exchange Line) found, get the exchange rate\n #If getPrice is directly called on a resource, call directly\n
with the reference currency\n #Resource_getPriceCalculationOperandDict on the resource\n
"""\n if movement is None:\n
for predicate in predicate_list:\n return context.Resource_getPriceCalculationOperandDict(**kw)\n
else:\n
predicate_list = context.portal_domains.searchPredicateList(\n
context=movement,portal_type=\'Currency Exchange Line\')\n
# For each predicate(i.e: Currency Exchange Line) found, get the exchange rate\n
# with the reference currency\n
for predicate in predicate_list:\n
return predicate.Resource_getPriceCalculationOperandDict(movement=predicate,**kw)\n return predicate.Resource_getPriceCalculationOperandDict(movement=predicate,**kw)\n
</string> </value> </string> </value>
</item> </item>
...@@ -91,7 +102,7 @@ for predicate in predicate_list:\n ...@@ -91,7 +102,7 @@ for predicate in predicate_list:\n
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>default=None, movement, REQUEST=None, **kw</string> </value> <value> <string>default=None,movement=None, REQUEST=None, **kw</string> </value>
</item> </item>
<item> <item>
<key> <string>errors</string> </key> <key> <string>errors</string> </key>
...@@ -121,12 +132,13 @@ for predicate in predicate_list:\n ...@@ -121,12 +132,13 @@ for predicate in predicate_list:\n
<string>movement</string> <string>movement</string>
<string>REQUEST</string> <string>REQUEST</string>
<string>kw</string> <string>kw</string>
<string>None</string>
<string>_apply_</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>predicate_list</string> <string>predicate_list</string>
<string>_getiter_</string> <string>_getiter_</string>
<string>predicate</string> <string>predicate</string>
<string>_apply_</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
419 420
\ 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