diff --git a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/InvoiceTransaction_postGenerationActivity.xml b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/InvoiceTransaction_postGenerationActivity.xml index 52a7c62e12ea54043946bf0b11050cf2dc22b920..83f62fa313bff4739f33354bac5c1c59433b42c0 100644 --- a/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/InvoiceTransaction_postGenerationActivity.xml +++ b/bt5/erp5_accounting/SkinTemplateItem/portal_skins/erp5_accounting/InvoiceTransaction_postGenerationActivity.xml @@ -90,14 +90,20 @@ invoice.Delivery_setCausalityFromSimulation()\n related_packing_list = invoice.getDefaultCausalityValue()\n #LOG(\'causality %s \' %invoice.getCausalityValueList())\n \n -# get a price_currency from the packing list\n -related_order = related_packing_list.getDefaultCausalityValue()\n -if related_order is not None:\n - price_currency = related_order.getPriceCurrency()\n +# XXX this use of currency is completly bogus, it should be set on simulation movements.\n +# get a price_currency from the packing list, or the order\n +price_currency = related_packing_list.getPriceCurrency()\n +if price_currency:\n invoice.edit(\n - resource = price_currency,\n - price_currency = price_currency,\n - )\n + resource=price_currency,\n + price_currency=price_currency,)\n +else:\n + related_order = related_packing_list.getDefaultCausalityValue()\n + if related_order is not None:\n + price_currency = related_order.getPriceCurrency()\n + invoice.edit(\n + resource=price_currency,\n + price_currency=price_currency,)\n \n # copy title, if not updating a new delivery\n if not invoice.getTitle():\n @@ -113,6 +119,7 @@ if invoice.getSimulationState() == \'draft\':\n except WorkflowException, e:\n # The user cannot pass the transition, it\'s OK\n pass\n +\n if invoice.getSimulationState() == \'draft\':\n # call the workflow method, if the user cannot perform this operation.\n invoice.plan()\n @@ -178,9 +185,9 @@ invoice.activate(\n <string>LOG</string> <string>_getattr_</string> <string>related_packing_list</string> + <string>price_currency</string> <string>related_order</string> <string>None</string> - <string>price_currency</string> <string>e</string> </tuple> </value> diff --git a/bt5/erp5_accounting/bt/revision b/bt5/erp5_accounting/bt/revision index 8cb9d84396bef2a990c7ffce27de7e99698e0c1a..941d0e591f298ec5df6cec8484dac4cda1c255ac 100644 --- a/bt5/erp5_accounting/bt/revision +++ b/bt5/erp5_accounting/bt/revision @@ -1 +1 @@ -475 \ No newline at end of file +479 \ No newline at end of file