Commit 4cd5a2bc authored by Aurel's avatar Aurel

when generating reference, do not reuse old one as it can lead to strange...

when generating reference, do not reuse old one as it can lead to strange reference generation if reference depends on a parameter the user can play with

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@14805 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e04f3f69
...@@ -102,12 +102,15 @@ if reference in (None, \'\') or not str(reference).startswith(application_id):\n ...@@ -102,12 +102,15 @@ if reference in (None, \'\') or not str(reference).startswith(application_id):\n
return \'\'\n return \'\'\n
\n \n
# actual generation\n # actual generation\n
if reference in (None, \'\'):\n #if reference in (None, \'\'): \n
#XXX is it necessary to concatenate to an old reference ?\n
# this make reference look strange when using different script to\n
# generate reference based on criteria the user can play with\n
baobab_id_group = (application_id, codification, year)\n baobab_id_group = (application_id, codification, year)\n
reference = context.portal_ids.generateNewLengthId(id_group = baobab_id_group)\n new_id = context.portal_ids.generateNewLengthId(id_group = baobab_id_group)\n
\n \n
# affectation\n # affectation\n
reference = "%s-%s-%s-%s" % (application_id, codification, year, reference)\n reference = "%s-%s-%s-%s" % (application_id, codification, year, new_id)\n
context.setSourceReference(reference)\n context.setSourceReference(reference)\n
\n \n
# finally, return it\n # finally, return it\n
...@@ -179,6 +182,7 @@ return reference\n ...@@ -179,6 +182,7 @@ return reference\n
<string>site</string> <string>site</string>
<string>site_value</string> <string>site_value</string>
<string>baobab_id_group</string> <string>baobab_id_group</string>
<string>new_id</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
276 277
\ 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