From 41cb2c0139402e478609a2258812f45aeb2dc3a4 Mon Sep 17 00:00:00 2001 From: Tatuya Kamada <tatuya@nexedi.com> Date: Fri, 19 Jun 2009 02:24:35 +0000 Subject: [PATCH] 2009-06-19 tatuya * Fix workflow scripts to enable to create Sale Invoices and Purchase Invoices when using erp5_advanced_invoicing git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@27670 20353a03-c40f-0410-a6d1-a30d3c3de9de --- .../scripts/PurchasePackingList_buildInvoice.xml | 13 +++++++++++-- .../scripts/SalePackingList_buildInvoice.xml | 13 +++++++++++-- bt5/erp5_trade/bt/change_log | 3 +++ bt5/erp5_trade/bt/revision | 2 +- 4 files changed, 26 insertions(+), 5 deletions(-) diff --git a/bt5/erp5_trade/WorkflowTemplateItem/portal_workflow/packing_list_workflow/scripts/PurchasePackingList_buildInvoice.xml b/bt5/erp5_trade/WorkflowTemplateItem/portal_workflow/packing_list_workflow/scripts/PurchasePackingList_buildInvoice.xml index f4e74f647e..a11a5c12b6 100644 --- a/bt5/erp5_trade/WorkflowTemplateItem/portal_workflow/packing_list_workflow/scripts/PurchasePackingList_buildInvoice.xml +++ b/bt5/erp5_trade/WorkflowTemplateItem/portal_workflow/packing_list_workflow/scripts/PurchasePackingList_buildInvoice.xml @@ -67,7 +67,13 @@ if packing_list.getPortalType() == \'Purchase Packing List\':\n # WARNING: this tag is also used in InvoiceTransaction_postGeneration script\n tax_tag = \'build_invoice_tax_%s\' % packing_list.getRelativeUrl()\n \n - invoice_line_builder = getattr(delivery_tool, \'purchase_invoice_builder\', None)\n + invoice_builder_name = \'purchase_invoice_builder\'\n + invoice_tax_builder_name = \'purchase_invoice_tax_builder\'\n + if \'Purchase Invoice Module\' in context.getPortalModuleTypeList():\n + invoice_builder_name = \'advanced_purchase_invoice_builder\'\n + invoice_tax_builder_name = \'advanced_purchase_invoice_tax_builder\'\n +\n + invoice_line_builder = getattr(delivery_tool, invoice_builder_name , None)\n if invoice_line_builder is not None:\n invoice_line_builder.activate(\n activity=\'SQLQueue\',\n @@ -80,7 +86,7 @@ if packing_list.getPortalType() == \'Purchase Packing List\':\n else:\n log(\'no purchase_invoice_builder found\')\n \n - invoice_tax_builder = getattr(delivery_tool, \'purchase_invoice_tax_builder\', None)\n + invoice_tax_builder = getattr(delivery_tool, invoice_tax_builder_name, None)\n if invoice_tax_builder is not None:\n invoice_tax_builder.activate(\n activity=\'SQLQueue\',\n @@ -140,6 +146,9 @@ if packing_list.getPortalType() == \'Purchase Packing List\':\n <string>None</string> <string>tag</string> <string>tax_tag</string> + <string>invoice_builder_name</string> + <string>invoice_tax_builder_name</string> + <string>context</string> <string>getattr</string> <string>invoice_line_builder</string> <string>dict</string> diff --git a/bt5/erp5_trade/WorkflowTemplateItem/portal_workflow/packing_list_workflow/scripts/SalePackingList_buildInvoice.xml b/bt5/erp5_trade/WorkflowTemplateItem/portal_workflow/packing_list_workflow/scripts/SalePackingList_buildInvoice.xml index 13c9f619c5..45e434259a 100644 --- a/bt5/erp5_trade/WorkflowTemplateItem/portal_workflow/packing_list_workflow/scripts/SalePackingList_buildInvoice.xml +++ b/bt5/erp5_trade/WorkflowTemplateItem/portal_workflow/packing_list_workflow/scripts/SalePackingList_buildInvoice.xml @@ -67,7 +67,13 @@ if packing_list.getPortalType() == \'Sale Packing List\':\n # WARNING: this tag is also used in InvoiceTransaction_postGeneration script\n tax_tag = \'build_invoice_tax_%s\' % packing_list.getRelativeUrl()\n \n - invoice_line_builder = getattr(delivery_tool, \'sale_invoice_builder\', None)\n + invoice_builder_name = \'sale_invoice_builder\'\n + invoice_tax_builder_name = \'sale_invoice_tax_builder\'\n + if \'Sale Invoice Module\' in context.getPortalModuleTypeList():\n + invoice_builder_name = \'advanced_sale_invoice_builder\'\n + invoice_tax_builder_name = \'advanced_sale_invoice_tax_builder\'\n + \n + invoice_line_builder = getattr(delivery_tool, invoice_builder_name, None)\n if invoice_line_builder is not None:\n invoice_line_builder.activate(\n activity=\'SQLQueue\',\n @@ -80,7 +86,7 @@ if packing_list.getPortalType() == \'Sale Packing List\':\n else:\n log(\'no sale_invoice_builder found\')\n \n - invoice_tax_builder = getattr(delivery_tool, \'sale_invoice_tax_builder\', None)\n + invoice_tax_builder = getattr(delivery_tool, invoice_tax_builder_name, None)\n if invoice_tax_builder is not None:\n invoice_tax_builder.activate(\n activity=\'SQLQueue\',\n @@ -140,6 +146,9 @@ if packing_list.getPortalType() == \'Sale Packing List\':\n <string>None</string> <string>tag</string> <string>tax_tag</string> + <string>invoice_builder_name</string> + <string>invoice_tax_builder_name</string> + <string>context</string> <string>getattr</string> <string>invoice_line_builder</string> <string>dict</string> diff --git a/bt5/erp5_trade/bt/change_log b/bt5/erp5_trade/bt/change_log index c3f2405a70..18d7d08c2d 100644 --- a/bt5/erp5_trade/bt/change_log +++ b/bt5/erp5_trade/bt/change_log @@ -1,3 +1,6 @@ +2009-06-19 tatuya +* Fix workflow scripts to enable to create Sale Invoices and Purchase Invoices when using erp5_advanced_invoicing + 2009-05-19 yusei * Fix some proxy fields. count_method should not be inherited from template field and proxy_listbox_ids had to be copied to new proxified fields but it was not copied. diff --git a/bt5/erp5_trade/bt/revision b/bt5/erp5_trade/bt/revision index 0552576c87..38bfa57c0c 100644 --- a/bt5/erp5_trade/bt/revision +++ b/bt5/erp5_trade/bt/revision @@ -1 +1 @@ -669 \ No newline at end of file +681 \ No newline at end of file -- 2.30.9