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 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>line = context\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
<value> <string>context.Base_initIntIndexAndReference(*args, **kw)\n
</string> </value>
</item>
<item>
......@@ -88,6 +80,12 @@ line.edit(reference=reference, int_index=index)\n
<none/>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>*args, **kw</string> </value>
......@@ -118,14 +116,9 @@ line.edit(reference=reference, int_index=index)\n
<tuple>
<string>args</string>
<string>kw</string>
<string>context</string>
<string>line</string>
<string>_apply_</string>
<string>_getattr_</string>
<string>parent</string>
<string>line_pt</string>
<string>len</string>
<string>index</string>
<string>reference</string>
<string>context</string>
</tuple>
</value>
</item>
......
......@@ -65,15 +65,7 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>line = context\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
<value> <string>context.Base_initIntIndexAndReference(*args, **kw)\n
</string> </value>
</item>
<item>
......@@ -88,6 +80,12 @@ line.edit(reference=reference, int_index=index)\n
<none/>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>*args, **kw</string> </value>
......@@ -118,15 +116,9 @@ line.edit(reference=reference, int_index=index)\n
<tuple>
<string>args</string>
<string>kw</string>
<string>context</string>
<string>line</string>
<string>_apply_</string>
<string>_getattr_</string>
<string>parent</string>
<string>line_pt</string>
<string>len</string>
<string>index</string>
<string>str</string>
<string>reference</string>
<string>context</string>
</tuple>
</value>
</item>
......
......@@ -65,19 +65,7 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>line = context\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
<value> <string>context.Base_initIntIndexAndReference(*args, **kw)\n
</string> </value>
</item>
<item>
......@@ -92,6 +80,12 @@ line.edit(reference=reference, int_index=index)\n
<none/>
</value>
</item>
<item>
<key> <string>_owner</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>*args, **kw</string> </value>
......@@ -122,15 +116,9 @@ line.edit(reference=reference, int_index=index)\n
<tuple>
<string>args</string>
<string>kw</string>
<string>context</string>
<string>line</string>
<string>_apply_</string>
<string>_getattr_</string>
<string>parent</string>
<string>line_pt</string>
<string>len</string>
<string>index</string>
<string>reference</string>
<string>str</string>
<string>context</string>
</tuple>
</value>
</item>
......
449
\ No newline at end of file
451
\ 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