Commit 4d4d1555 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

* create InternalSupplyLine_init and use it in Internal Supply Line.

* reduce duplicated code.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32711 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 3c163c76
......@@ -76,7 +76,7 @@
</item>
<item>
<key> <string>init_script</string> </key>
<value> <string>SaleSupplyLine_init</string> </value>
<value> <string>InternalSupplyLine_init</string> </value>
</item>
<item>
<key> <string>permission</string> </key>
......
......@@ -53,18 +53,7 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string># XXX Set a resource for the supply line inside a resource\n
if context.getParentValue().getPortalType() in \\\n
context.getPortalResourceTypeList():\n
context.setResourceValue(context.getParentValue())\n
# Predicate ?\n
context.setMappedValuePropertyList([\n
\'base_price\', \'additional_price\',\n
\'discount_ratio\', \'exclusive_discount_ratio\',\n
\'surcharge_ratio\', \'variable_additional_price\',\n
\'non_discountable_additional_price\',\n
\'priced_quantity\',\n
])\n
<value> <string>return context.SupplyLine_init(**kw)\n
</string> </value>
</item>
<item>
......@@ -102,6 +91,7 @@ context.setMappedValuePropertyList([\n
<value>
<tuple>
<string>kw</string>
<string>_apply_</string>
<string>_getattr_</string>
<string>context</string>
</tuple>
......
......@@ -53,18 +53,7 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string># XXX Set a resource for the supply line inside a resource\n
if context.getParentValue().getPortalType() in \\\n
context.getPortalResourceTypeList():\n
context.setResourceValue(context.getParentValue())\n
# Predicate ?\n
context.setMappedValuePropertyList([\n
\'base_price\', \'additional_price\',\n
\'discount_ratio\', \'exclusive_discount_ratio\',\n
\'surcharge_ratio\', \'variable_additional_price\',\n
\'non_discountable_additional_price\',\n
\'priced_quantity\', \'base_unit_price\',\n
])\n
<value> <string>return context.SupplyLine_init(**kw)\n
</string> </value>
</item>
<item>
......@@ -102,6 +91,7 @@ context.setMappedValuePropertyList([\n
<value>
<tuple>
<string>kw</string>
<string>_apply_</string>
<string>_getattr_</string>
<string>context</string>
</tuple>
......
......@@ -53,18 +53,7 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string># XXX Set a resource for the supply line inside a resource\n
if context.getParentValue().getPortalType() in \\\n
context.getPortalResourceTypeList():\n
context.setResourceValue(context.getParentValue())\n
# Predicate ?\n
context.setMappedValuePropertyList([\n
\'base_price\', \'additional_price\',\n
\'discount_ratio\', \'exclusive_discount_ratio\',\n
\'surcharge_ratio\', \'variable_additional_price\',\n
\'non_discountable_additional_price\',\n
\'priced_quantity\', \'base_unit_price\',\n
])\n
<value> <string>return context.SupplyLine_init(**kw)\n
</string> </value>
</item>
<item>
......@@ -102,6 +91,7 @@ context.setMappedValuePropertyList([\n
<value>
<tuple>
<string>kw</string>
<string>_apply_</string>
<string>_getattr_</string>
<string>context</string>
</tuple>
......
......@@ -54,16 +54,16 @@
<item>
<key> <string>_body</string> </key>
<value> <string># XXX Set a resource for the supply line inside a resource\n
if context.getParentValue().getPortalType() in \\\n
context.getPortalResourceTypeList():\n
context.setResourceValue(context.getParentValue())\n
parent_value = context.getParentValue()\n
if parent_value.getPortalType() in context.getPortalResourceTypeList():\n
context.setResourceValue(parent_value)\n
# Predicate ?\n
context.setMappedValuePropertyList([\n
\'base_price\', \'additional_price\',\n
\'discount_ratio\', \'exclusive_discount_ratio\',\n
\'surcharge_ratio\', \'variable_additional_price\',\n
\'non_discountable_additional_price\',\n
\'priced_quantity\',\n
\'priced_quantity\', \'base_unit_price\',\n
])\n
</string> </value>
</item>
......@@ -104,6 +104,7 @@ context.setMappedValuePropertyList([\n
<string>kw</string>
<string>_getattr_</string>
<string>context</string>
<string>parent_value</string>
</tuple>
</value>
</item>
......
448
\ No newline at end of file
449
\ 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