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 @@
<list>
<string>my_start_date</string>
<string>my_stop_date</string>
<string>my_translated_validation_state_title</string>
</list>
</value>
</item>
......@@ -99,6 +98,7 @@
<value>
<list>
<string>listbox_base_price</string>
<string>listbox_discount</string>
</list>
</value>
</item>
......@@ -117,6 +117,7 @@
<list>
<string>my_source_title</string>
<string>my_base_price</string>
<string>my_translated_validation_state_title</string>
</list>
</value>
</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,16 +65,27 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>"Search for all predicates that corresponds to this particular context"\n
predicate_list = context.portal_domains.searchPredicateList(\n
context=movement,portal_type=\'Currency Exchange Line\')\n
<value> <string>"""\n
Search for all predicates that corresponds to this particular context\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
For each predicate(i.e: Currency Exchange Line) found, get the exchange rate\n
with the reference currency\n
"""\n
for predicate in predicate_list:\n
return predicate.Resource_getPriceCalculationOperandDict(movement=predicate,**kw)\n
#If getPrice is directly called on a resource, call directly\n
#Resource_getPriceCalculationOperandDict on the resource\n
if movement is None:\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
</string> </value>
</item>
<item>
......@@ -91,7 +102,7 @@ for predicate in predicate_list:\n
</item>
<item>
<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>
<key> <string>errors</string> </key>
......@@ -121,12 +132,13 @@ for predicate in predicate_list:\n
<string>movement</string>
<string>REQUEST</string>
<string>kw</string>
<string>None</string>
<string>_apply_</string>
<string>_getattr_</string>
<string>context</string>
<string>predicate_list</string>
<string>_getiter_</string>
<string>predicate</string>
<string>_apply_</string>
</tuple>
</value>
</item>
......
419
\ No newline at end of file
420
\ 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