[Erp5-report] r25379 - in /erp5/trunk/bt5/erp5_invoicing: SkinTemplateItem/portal_skins/erp...

nobody at svn.erp5.org nobody at svn.erp5.org
Fri Jan 30 13:56:19 CET 2009


Author: jerome
Date: Fri Jan 30 13:56:18 2009
New Revision: 25379

URL: http://svn.erp5.org?rev=25379&view=rev
Log:
style cleanup

Modified:
    erp5/trunk/bt5/erp5_invoicing/SkinTemplateItem/portal_skins/erp5_invoicing/InvoiceTransaction_postTransactionLineGeneration.xml
    erp5/trunk/bt5/erp5_invoicing/bt/revision

Modified: erp5/trunk/bt5/erp5_invoicing/SkinTemplateItem/portal_skins/erp5_invoicing/InvoiceTransaction_postTransactionLineGeneration.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_invoicing/SkinTemplateItem/portal_skins/erp5_invoicing/InvoiceTransaction_postTransactionLineGeneration.xml?rev=25379&r1=25378&r2=25379&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_invoicing/SkinTemplateItem/portal_skins/erp5_invoicing/InvoiceTransaction_postTransactionLineGeneration.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_invoicing/SkinTemplateItem/portal_skins/erp5_invoicing/InvoiceTransaction_postTransactionLineGeneration.xml [utf8] Fri Jan 30 13:56:18 2009
@@ -54,45 +54,32 @@
         <item>
             <key> <string>_body</string> </key>
             <value> <string>#\n
-#  this script is called on the Sale Invoice Transaction\n
-# after the sale_invoice_transaction_builder delivery builder\n
-# created Sale Invoice Transaction Line\n
+#  this script is called on the Invoice Transaction\n
+# after the invoice_transaction_builder delivery builder\n
+# created accounting lines in the invoice\n
 # \n
-from Products.ERP5Type.Log import log\n
-LOG = lambda msg:log(\n
-          "SaleInvoiceTransaction_postTransactionLineGeneration", msg)\n
-\n
-sale_invoice = context\n
 \n
 # Accounting specific: \n
 #  if every lines have the same resource, then copy the resource \n
 # on the Transaction and delete resource on the lines.\n
+# TODO: this is a Property Assignment Movement Group\n
 \n
-accounting_line_portal_type = (\n
-                    "Sale Invoice Transaction Line",\n
-                    "Purchase Invoice Transaction Line",\n
-                    "Accounting Transaction Line")\n
-\n
+accounting_line_portal_type = context.getPortalAccountingMovementTypeList()\n
 resources_keys = {}\n
-\n
-for line in sale_invoice.objectValues() :\n
-  if line.getPortalType() not in accounting_line_portal_type :\n
-    continue\n
-  else : \n
-    resources_keys[line.getResource()] = 1\n
+for line in context.contentValues(portal_type=accounting_line_portal_type):\n
+  resources_keys[line.getResource()] = 1\n
 \n
 if len(resources_keys.keys()) == 1 :\n
   # set the resource on the transaction\n
-  sale_invoice.setResource(resources_keys.keys()[0])\n
+  context.setResource(resources_keys.keys()[0])\n
   # and delete on the invoice lines, so that if the user\n
   # changes the ressource on the transaction, it also change on \n
   # the lines. \n
-  for line in sale_invoice.objectValues() :\n
-    if line.getPortalType() in accounting_line_portal_type :\n
-      line.setResource(None)\n
-      assert(line.getResource() == sale_invoice.getResource())\n
+  for line in context.contentValues(portal_type=accounting_line_portal_type):\n
+    line.setResource(None)\n
+    assert(line.getResource() == sale_invoice.getResource())\n
 else :\n
-  raise ValueError, "%s doesn(t have only one resource %s" % (\n
+  raise ValueError, "%s doesn\'t have only one resource %s" % (\n
               sale_invoice.getPath(), resources_keys.keys())\n
 \n
 # round debit / credit on created transaction.\n
@@ -134,20 +121,17 @@
                         <value>
                           <tuple>
                             <string>kw</string>
-                            <string>Products.ERP5Type.Log</string>
-                            <string>log</string>
-                            <string>LOG</string>
+                            <string>_getattr_</string>
                             <string>context</string>
-                            <string>sale_invoice</string>
                             <string>accounting_line_portal_type</string>
                             <string>resources_keys</string>
                             <string>_getiter_</string>
-                            <string>_getattr_</string>
                             <string>line</string>
                             <string>_write_</string>
                             <string>len</string>
                             <string>_getitem_</string>
                             <string>None</string>
+                            <string>sale_invoice</string>
                             <string>AssertionError</string>
                             <string>ValueError</string>
                           </tuple>

Modified: erp5/trunk/bt5/erp5_invoicing/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_invoicing/bt/revision?rev=25379&r1=25378&r2=25379&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_invoicing/bt/revision [utf8] (original)
+++ erp5/trunk/bt5/erp5_invoicing/bt/revision [utf8] Fri Jan 30 13:56:18 2009
@@ -1,1 +1,1 @@
-192
+193




More information about the Erp5-report mailing list