Commit 076a3321 authored by Jérome Perrin's avatar Jérome Perrin

Base_initIntIndexAndReference and DeliveryCell_init, DeliveryLine_init,...

Base_initIntIndexAndReference and DeliveryCell_init, DeliveryLine_init, OrderLine_init looks identical. Stop code duplication

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@22730 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c51ca4d6
...@@ -65,15 +65,7 @@ ...@@ -65,15 +65,7 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>line = context\n <value> <string>context.Base_initIntIndexAndReference(*args, **kw)\n
parent = context.getParentValue()\n
\n
line_pt = line.getPortalType()\n
\n
index = len(parent.contentValues(filter={"portal_type": line_pt}))\n
reference = "%s.%s" % (parent.getReference(), index)\n
\n
line.edit(reference=reference, int_index=index)\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -88,6 +80,12 @@ line.edit(reference=reference, int_index=index)\n ...@@ -88,6 +80,12 @@ line.edit(reference=reference, int_index=index)\n
<none/> <none/>
</value> </value>
</item> </item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>*args, **kw</string> </value> <value> <string>*args, **kw</string> </value>
...@@ -118,14 +116,9 @@ line.edit(reference=reference, int_index=index)\n ...@@ -118,14 +116,9 @@ line.edit(reference=reference, int_index=index)\n
<tuple> <tuple>
<string>args</string> <string>args</string>
<string>kw</string> <string>kw</string>
<string>context</string> <string>_apply_</string>
<string>line</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>parent</string> <string>context</string>
<string>line_pt</string>
<string>len</string>
<string>index</string>
<string>reference</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -65,15 +65,7 @@ ...@@ -65,15 +65,7 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>line = context\n <value> <string>context.Base_initIntIndexAndReference(*args, **kw)\n
parent = context.getParentValue()\n
\n
line_pt = line.getPortalType()\n
\n
index = len(parent.contentValues(filter={"portal_type": line_pt}))\n
reference = str(index)\n
\n
line.edit(reference=reference, int_index=index)\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -88,6 +80,12 @@ line.edit(reference=reference, int_index=index)\n ...@@ -88,6 +80,12 @@ line.edit(reference=reference, int_index=index)\n
<none/> <none/>
</value> </value>
</item> </item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>*args, **kw</string> </value> <value> <string>*args, **kw</string> </value>
...@@ -118,15 +116,9 @@ line.edit(reference=reference, int_index=index)\n ...@@ -118,15 +116,9 @@ line.edit(reference=reference, int_index=index)\n
<tuple> <tuple>
<string>args</string> <string>args</string>
<string>kw</string> <string>kw</string>
<string>context</string> <string>_apply_</string>
<string>line</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>parent</string> <string>context</string>
<string>line_pt</string>
<string>len</string>
<string>index</string>
<string>str</string>
<string>reference</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
...@@ -65,19 +65,7 @@ ...@@ -65,19 +65,7 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>line = context\n <value> <string>context.Base_initIntIndexAndReference(*args, **kw)\n
parent = context.getParentValue()\n
\n
line_pt = line.getPortalType()\n
\n
index = len(parent.contentValues(filter={"portal_type": line_pt}))\n
\n
if parent.getPortalType() == line_pt:\n
reference = "%s.%s" % (parent.getReference(), index)\n
else:\n
reference = str(index)\n
\n
line.edit(reference=reference, int_index=index)\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -92,6 +80,12 @@ line.edit(reference=reference, int_index=index)\n ...@@ -92,6 +80,12 @@ line.edit(reference=reference, int_index=index)\n
<none/> <none/>
</value> </value>
</item> </item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>*args, **kw</string> </value> <value> <string>*args, **kw</string> </value>
...@@ -122,15 +116,9 @@ line.edit(reference=reference, int_index=index)\n ...@@ -122,15 +116,9 @@ line.edit(reference=reference, int_index=index)\n
<tuple> <tuple>
<string>args</string> <string>args</string>
<string>kw</string> <string>kw</string>
<string>context</string> <string>_apply_</string>
<string>line</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>parent</string> <string>context</string>
<string>line_pt</string>
<string>len</string>
<string>index</string>
<string>reference</string>
<string>str</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
449 451
\ 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