[Erp5-report] r29685 - in /erp5/trunk/bt5/erp5_accounting: WorkflowTemplateItem/portal_work...

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Oct 15 17:15:27 CEST 2009


Author: jerome
Date: Thu Oct 15 17:15:24 2009
New Revision: 29685

URL: http://svn.erp5.org?rev=29685&view=rev
Log:
use conflict-free id generator

Modified:
    erp5/trunk/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_workflow/scripts/setReferences.xml
    erp5/trunk/bt5/erp5_accounting/bt/revision

Modified: erp5/trunk/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_workflow/scripts/setReferences.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_workflow/scripts/setReferences.xml?rev=29685&r1=29684&r2=29685&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_workflow/scripts/setReferences.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_workflow/scripts/setReferences.xml [utf8] Thu Oct 15 17:15:24 2009
@@ -62,12 +62,14 @@
 source_section = transaction.getSourceSection()\n
 destination_section = transaction.getDestinationSection()\n
 \n
+id_generator = state_change.getPortal().portal_ids.generateNewLengthId\n
+\n
 # Invoice Reference is automatically filled only for Sale Invoice Transaction.\n
 if transaction.getPortalType() == \'Sale Invoice Transaction\':\n
   if not transaction.getReference():\n
     invoice_id_group = (\'accounting\', \'invoice\', source_section)\n
-    invoice_reference = transaction.generateNewId(id_group=invoice_id_group,\n
-                                                  default=1)\n
+    invoice_reference = id_generator(id_group=invoice_id_group,\n
+                                     default=1)\n
     transaction.setReference(invoice_reference)\n
 \n
 \n
@@ -80,8 +82,7 @@
   if not period_code:\n
     period_code = str(transaction.getStartDate().year())\n
   source_id_group = (\'accounting\', \'section\', source_section, period_code)\n
-  source_reference = transaction.generateNewId(id_group=source_id_group,\n
-                                               default=1)\n
+  source_reference = id_generator(id_group=source_id_group, default=1)\n
   transaction.setSourceReference(\'%s-%s\' % (period_code, source_reference))\n
 \n
 if not transaction.getDestinationReference():\n
@@ -92,8 +93,7 @@
   if not period_code:\n
     period_code = str(transaction.getStopDate().year())\n
   destination_id_group = (\'accounting\', \'section\', destination_section, period_code)\n
-  destination_reference = transaction.generateNewId(\n
-                              id_group=destination_id_group, default=1)\n
+  destination_reference = id_generator(id_group=destination_id_group, default=1)\n
   transaction.setDestinationReference(\'%s-%s\' % (period_code, destination_reference))\n
 </string> </value>
         </item>
@@ -145,6 +145,7 @@
                             <string>_getattr_</string>
                             <string>source_section</string>
                             <string>destination_section</string>
+                            <string>id_generator</string>
                             <string>invoice_id_group</string>
                             <string>invoice_reference</string>
                             <string>period</string>

Modified: erp5/trunk/bt5/erp5_accounting/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/bt/revision?rev=29685&r1=29684&r2=29685&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/bt/revision [utf8] (original)
+++ erp5/trunk/bt5/erp5_accounting/bt/revision [utf8] Thu Oct 15 17:15:24 2009
@@ -1,1 +1,1 @@
-989
+990




More information about the Erp5-report mailing list