Commit aa28ca1a authored by Jérome Perrin's avatar Jérome Perrin

do not assume the causality packing list is always related to an Order


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@5989 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b1f552d1
...@@ -82,19 +82,20 @@ LOG = lambda msg:context.log(\n ...@@ -82,19 +82,20 @@ LOG = lambda msg:context.log(\n
sale_invoice.Delivery_setCausalityFromSimulation()\n sale_invoice.Delivery_setCausalityFromSimulation()\n
\n \n
related_packing_list = sale_invoice.getDefaultCausalityValue()\n related_packing_list = sale_invoice.getDefaultCausalityValue()\n
LOG(\'causality %s \' %sale_invoice.getCausalityValueList())\n #LOG(\'causality %s \' %sale_invoice.getCausalityValueList())\n
\n \n
# get a price_currency for the order\n # get a price_currency from the packing list\n
related_order = related_packing_list.getDefaultCausalityValue()\n related_order = related_packing_list.getDefaultCausalityValue()\n
price_currency = related_order.getPriceCurrency()\n if related_order is not None :\n
\n price_currency = related_order.getPriceCurrency()\n
# copy some properties from the first related packing list\n sale_invoice.edit(\n
sale_invoice.edit(\n resource = price_currency,\n
title = related_packing_list.getTitle(),\n price_currency = price_currency,\n
resource = price_currency,\n )\n
price_currency = price_currency,\n \n
reference = related_packing_list.getReference(),\n # copy title, if not updating a new delivery\n
)\n if sale_invoice.getTitle() is None :\n
sale_invoice.setTitle(related_packing_list.getTitle())\n
\n \n
# initialize accounting_workflow to planned state\n # initialize accounting_workflow to planned state\n
if sale_invoice.getSimulationState() == \'draft\' : \n if sale_invoice.getSimulationState() == \'draft\' : \n
...@@ -168,6 +169,7 @@ sale_invoice.activate(\n ...@@ -168,6 +169,7 @@ sale_invoice.activate(\n
<string>_getattr_</string> <string>_getattr_</string>
<string>related_packing_list</string> <string>related_packing_list</string>
<string>related_order</string> <string>related_order</string>
<string>None</string>
<string>price_currency</string> <string>price_currency</string>
<string>RuntimeError</string> <string>RuntimeError</string>
<string>e</string> <string>e</string>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment