Commit 48674c62 authored by Alexandre Boeglin's avatar Alexandre Boeglin

pass portal_type_list parameter to getPriceCalculationOperandDict based on context.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@19227 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 5e80649d
...@@ -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>
...@@ -68,9 +65,21 @@ ...@@ -68,9 +65,21 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>resource = context.getResourceValue()\n <value> <string>portal_type_list = None\n
\n
explanation = context.getExplanationValue()\n
if explanation is not None:\n
explanation_type = explanation.getPortalType()\n
# XXX FIXME: Hardcoded values\n
if "Purchase" in explanation_type:\n
portal_type_list = ("Purchase Supply Line", "Purchase Supply Cell", "Supply Line", "Supply Cell")\n
elif "Sale" in explanation_type:\n
portal_type_list = ("Sale Supply Line", "Sale Supply Cell", "Supply Line", "Supply Cell")\n
\n
resource = context.getResourceValue()\n
if resource is not None:\n if resource is not None:\n
return resource.getPriceCalculationOperandDict(default=default, context=context, **kw)\n return resource.getPriceCalculationOperandDict(default=default, context=context,\n
portal_type_list=portal_type_list, **kw)\n
else:\n else:\n
return default\n return default\n
</string> </value> </string> </value>
...@@ -123,10 +132,13 @@ else:\n ...@@ -123,10 +132,13 @@ else:\n
<tuple> <tuple>
<string>default</string> <string>default</string>
<string>kw</string> <string>kw</string>
<string>None</string>
<string>portal_type_list</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>explanation</string>
<string>explanation_type</string>
<string>resource</string> <string>resource</string>
<string>None</string>
<string>_apply_</string> <string>_apply_</string>
</tuple> </tuple>
</value> </value>
......
698 699
\ 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