[Erp5-report] r20470 - in /erp5/trunk/bt5/erp5_trade: WorkflowTemplateItem/portal_workflow/...

nobody at svn.erp5.org nobody at svn.erp5.org
Mon Apr 14 11:18:57 CEST 2008


Author: jerome
Date: Mon Apr 14 11:18:56 2008
New Revision: 20470

URL: http://svn.erp5.org?rev=20470&view=rev
Log:
activate builder for invoice lines, then builder for tax lines.

Modified:
    erp5/trunk/bt5/erp5_trade/WorkflowTemplateItem/portal_workflow/packing_list_workflow/scripts/PurchasePackingList_buildInvoice.xml
    erp5/trunk/bt5/erp5_trade/WorkflowTemplateItem/portal_workflow/packing_list_workflow/scripts/SalePackingList_buildInvoice.xml
    erp5/trunk/bt5/erp5_trade/bt/revision

Modified: erp5/trunk/bt5/erp5_trade/WorkflowTemplateItem/portal_workflow/packing_list_workflow/scripts/PurchasePackingList_buildInvoice.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_trade/WorkflowTemplateItem/portal_workflow/packing_list_workflow/scripts/PurchasePackingList_buildInvoice.xml?rev=20470&r1=20469&r2=20470&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_trade/WorkflowTemplateItem/portal_workflow/packing_list_workflow/scripts/PurchasePackingList_buildInvoice.xml (original)
+++ erp5/trunk/bt5/erp5_trade/WorkflowTemplateItem/portal_workflow/packing_list_workflow/scripts/PurchasePackingList_buildInvoice.xml Mon Apr 14 11:18:56 2008
@@ -65,10 +65,36 @@
         </item>
         <item>
             <key> <string>_body</string> </key>
-            <value> <string>packing_list =sci[\'object\']\n
+            <value> <string>from Products.ERP5Type.Log import log\n
+packing_list = sci[\'object\']\n
+delivery_tool = sci.getPortal().portal_deliveries\n
 \n
 if packing_list.getPortalType() == \'Purchase Packing List\':\n
-  return context.PackingList_buildInvoice(sci)\n
+  tag = \'build_invoice_%s\' % packing_list.getRelativeUrl()\n
+  invoice_line_builder = getattr(delivery_tool, \'purchase_invoice_builder\', None)\n
+  if invoice_line_builder is not None:\n
+    invoice_line_builder.activate(\n
+          tag=tag,\n
+          activate_kw=dict(tag=tag),\n
+          after_method_id = [ \'expand\', \n
+                              \'recursiveImmediateReindexObject\',\n
+                              \'updateAppliedRule\',\n
+                              \'immediateReindexObject\' ],\n
+          ).build()\n
+  else:\n
+    log(\'no purchase_invoice_builder found\')\n
+\n
+  invoice_tax_builder = getattr(delivery_tool, \'purchase_invoice_tax_builder\', None)\n
+  if invoice_tax_builder is not None:\n
+    invoice_tax_builder.activate(\n
+          tag=tag,\n
+          after_method_id = [ \'expand\', \n
+                              \'recursiveImmediateReindexObject\',\n
+                              \'updateAppliedRule\',\n
+                              \'immediateReindexObject\' ],\n
+          ).build()\n
+  else:\n
+    log(\'no purchase_invoice_tax_builder found\')\n
 </string> </value>
         </item>
         <item>
@@ -112,10 +138,18 @@
                         <value>
                           <tuple>
                             <string>sci</string>
+                            <string>Products.ERP5Type.Log</string>
+                            <string>log</string>
                             <string>_getitem_</string>
                             <string>packing_list</string>
                             <string>_getattr_</string>
-                            <string>context</string>
+                            <string>delivery_tool</string>
+                            <string>tag</string>
+                            <string>getattr</string>
+                            <string>None</string>
+                            <string>invoice_line_builder</string>
+                            <string>dict</string>
+                            <string>invoice_tax_builder</string>
                           </tuple>
                         </value>
                     </item>

Modified: erp5/trunk/bt5/erp5_trade/WorkflowTemplateItem/portal_workflow/packing_list_workflow/scripts/SalePackingList_buildInvoice.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_trade/WorkflowTemplateItem/portal_workflow/packing_list_workflow/scripts/SalePackingList_buildInvoice.xml?rev=20470&r1=20469&r2=20470&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_trade/WorkflowTemplateItem/portal_workflow/packing_list_workflow/scripts/SalePackingList_buildInvoice.xml (original)
+++ erp5/trunk/bt5/erp5_trade/WorkflowTemplateItem/portal_workflow/packing_list_workflow/scripts/SalePackingList_buildInvoice.xml Mon Apr 14 11:18:56 2008
@@ -65,10 +65,36 @@
         </item>
         <item>
             <key> <string>_body</string> </key>
-            <value> <string>packing_list =sci[\'object\']\n
+            <value> <string>from Products.ERP5Type.Log import log\n
+packing_list = sci[\'object\']\n
+delivery_tool = sci.getPortal().portal_deliveries\n
 \n
 if packing_list.getPortalType() == \'Sale Packing List\':\n
-  return context.PackingList_buildInvoice(sci)\n
+  tag = \'build_invoice_%s\' % packing_list.getRelativeUrl()\n
+  invoice_line_builder = getattr(delivery_tool, \'sale_invoice_builder\', None)\n
+  if invoice_line_builder is not None:\n
+    invoice_line_builder.activate(\n
+          tag=tag,\n
+          activate_kw=dict(tag=tag),\n
+          after_method_id = [ \'expand\', \n
+                              \'recursiveImmediateReindexObject\',\n
+                              \'updateAppliedRule\',\n
+                              \'immediateReindexObject\' ],\n
+          ).build()\n
+  else:\n
+    log(\'no sale_invoice_builder found\')\n
+\n
+  invoice_tax_builder = getattr(delivery_tool, \'sale_invoice_tax_builder\', None)\n
+  if invoice_tax_builder is not None:\n
+    invoice_tax_builder.activate(\n
+          tag=tag,\n
+          after_method_id = [ \'expand\', \n
+                              \'recursiveImmediateReindexObject\',\n
+                              \'updateAppliedRule\',\n
+                              \'immediateReindexObject\' ],\n
+          ).build()\n
+  else:\n
+    log(\'no sale_invoice_tax_builder found\')\n
 </string> </value>
         </item>
         <item>
@@ -112,10 +138,18 @@
                         <value>
                           <tuple>
                             <string>sci</string>
+                            <string>Products.ERP5Type.Log</string>
+                            <string>log</string>
                             <string>_getitem_</string>
                             <string>packing_list</string>
                             <string>_getattr_</string>
-                            <string>context</string>
+                            <string>delivery_tool</string>
+                            <string>tag</string>
+                            <string>getattr</string>
+                            <string>None</string>
+                            <string>invoice_line_builder</string>
+                            <string>dict</string>
+                            <string>invoice_tax_builder</string>
                           </tuple>
                         </value>
                     </item>

Modified: erp5/trunk/bt5/erp5_trade/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_trade/bt/revision?rev=20470&r1=20469&r2=20470&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_trade/bt/revision (original)
+++ erp5/trunk/bt5/erp5_trade/bt/revision Mon Apr 14 11:18:56 2008
@@ -1,1 +1,1 @@
-255
+256




More information about the Erp5-report mailing list