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

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Jul 23 11:01:53 CEST 2007


Author: jerome
Date: Mon Jul 23 11:01:52 2007
New Revision: 15273

URL: http://svn.erp5.org?rev=15273&view=rev
Log:
When setting source|destination reference, assign 1 for the first reference, not 0.

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=15273&r1=15272&r2=15273&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_workflow/scripts/setReferences.xml (original)
+++ erp5/trunk/bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_workflow/scripts/setReferences.xml Mon Jul 23 11:01:52 2007
@@ -68,8 +68,7 @@
         </item>
         <item>
             <key> <string>_body</string> </key>
-            <value> <string># Purchase Invoice Transaction or Sale Invoice Transaction.\n
-transaction = state_change[\'object\']\n
+            <value> <string>transaction = state_change[\'object\']\n
 \n
 # Get sections.\n
 source_section = transaction.getSourceSection()\n
@@ -77,19 +76,22 @@
 \n
 # Invoice Reference is automatically filled only for Sale Invoice Transaction.\n
 if transaction.getPortalType() == \'Sale Invoice Transaction\':\n
-  if transaction.getReference() in (None, \'\'):\n
+  if not transaction.getReference():\n
     invoice_id_group = (\'accounting\', \'invoice\', source_section)\n
-    invoice_reference = transaction.generateNewId(id_group = invoice_id_group)\n
+    invoice_reference = transaction.generateNewId(id_group=invoice_id_group,\n
+                                                  default=1)\n
     transaction.setReference(invoice_reference)\n
 \n
 # Generate new values for Source Reference and Destination Reference.\n
-if transaction.getSourceReference() in (None, \'\'):\n
+if not transaction.getSourceReference():\n
   source_id_group = (\'accounting\', \'section\', source_section)\n
-  source_reference = transaction.generateNewId(id_group = source_id_group)\n
+  source_reference = transaction.generateNewId(id_group=source_id_group,\n
+                                               default=1)\n
   transaction.setSourceReference(source_reference)\n
-if transaction.getDestinationReference() in (None, \'\'):\n
+if not transaction.getDestinationReference():\n
   destination_id_group = (\'accounting\', \'section\', destination_section)\n
-  destination_reference = transaction.generateNewId(id_group = destination_id_group)\n
+  destination_reference = transaction.generateNewId(\n
+                              id_group=destination_id_group, default=1)\n
   transaction.setDestinationReference(destination_reference)\n
 </string> </value>
         </item>
@@ -145,7 +147,6 @@
                             <string>_getattr_</string>
                             <string>source_section</string>
                             <string>destination_section</string>
-                            <string>None</string>
                             <string>invoice_id_group</string>
                             <string>invoice_reference</string>
                             <string>source_id_group</string>

Modified: erp5/trunk/bt5/erp5_accounting/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_accounting/bt/revision?rev=15273&r1=15272&r2=15273&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_accounting/bt/revision (original)
+++ erp5/trunk/bt5/erp5_accounting/bt/revision Mon Jul 23 11:01:52 2007
@@ -1,1 +1,1 @@
-364
+365




More information about the Erp5-report mailing list