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 @@ ...@@ -76,7 +76,7 @@
</item> </item>
<item> <item>
<key> <string>init_script</string> </key> <key> <string>init_script</string> </key>
<value> <string>SaleSupplyLine_init</string> </value> <value> <string>InternalSupplyLine_init</string> </value>
</item> </item>
<item> <item>
<key> <string>permission</string> </key> <key> <string>permission</string> </key>
......
...@@ -53,18 +53,7 @@ ...@@ -53,18 +53,7 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string># XXX Set a resource for the supply line inside a resource\n <value> <string>return context.SupplyLine_init(**kw)\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
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -102,6 +91,7 @@ context.setMappedValuePropertyList([\n ...@@ -102,6 +91,7 @@ context.setMappedValuePropertyList([\n
<value> <value>
<tuple> <tuple>
<string>kw</string> <string>kw</string>
<string>_apply_</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
</tuple> </tuple>
......
...@@ -53,18 +53,7 @@ ...@@ -53,18 +53,7 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string># XXX Set a resource for the supply line inside a resource\n <value> <string>return context.SupplyLine_init(**kw)\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
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -102,6 +91,7 @@ context.setMappedValuePropertyList([\n ...@@ -102,6 +91,7 @@ context.setMappedValuePropertyList([\n
<value> <value>
<tuple> <tuple>
<string>kw</string> <string>kw</string>
<string>_apply_</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
</tuple> </tuple>
......
...@@ -53,18 +53,7 @@ ...@@ -53,18 +53,7 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string># XXX Set a resource for the supply line inside a resource\n <value> <string>return context.SupplyLine_init(**kw)\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
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -102,6 +91,7 @@ context.setMappedValuePropertyList([\n ...@@ -102,6 +91,7 @@ context.setMappedValuePropertyList([\n
<value> <value>
<tuple> <tuple>
<string>kw</string> <string>kw</string>
<string>_apply_</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
</tuple> </tuple>
......
...@@ -54,16 +54,16 @@ ...@@ -54,16 +54,16 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string># XXX Set a resource for the supply line inside a resource\n <value> <string># XXX Set a resource for the supply line inside a resource\n
if context.getParentValue().getPortalType() in \\\n parent_value = context.getParentValue()\n
context.getPortalResourceTypeList():\n if parent_value.getPortalType() in context.getPortalResourceTypeList():\n
context.setResourceValue(context.getParentValue())\n context.setResourceValue(parent_value)\n
# Predicate ?\n # Predicate ?\n
context.setMappedValuePropertyList([\n context.setMappedValuePropertyList([\n
\'base_price\', \'additional_price\',\n \'base_price\', \'additional_price\',\n
\'discount_ratio\', \'exclusive_discount_ratio\',\n \'discount_ratio\', \'exclusive_discount_ratio\',\n
\'surcharge_ratio\', \'variable_additional_price\',\n \'surcharge_ratio\', \'variable_additional_price\',\n
\'non_discountable_additional_price\',\n \'non_discountable_additional_price\',\n
\'priced_quantity\',\n \'priced_quantity\', \'base_unit_price\',\n
])\n ])\n
</string> </value> </string> </value>
</item> </item>
...@@ -104,6 +104,7 @@ context.setMappedValuePropertyList([\n ...@@ -104,6 +104,7 @@ context.setMappedValuePropertyList([\n
<string>kw</string> <string>kw</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>parent_value</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
448 449
\ 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