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

Get the price currency from the packing list, then from the order if not found on packing list

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17362 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d1e824b6
...@@ -90,14 +90,20 @@ invoice.Delivery_setCausalityFromSimulation()\n ...@@ -90,14 +90,20 @@ invoice.Delivery_setCausalityFromSimulation()\n
related_packing_list = invoice.getDefaultCausalityValue()\n related_packing_list = invoice.getDefaultCausalityValue()\n
#LOG(\'causality %s \' %invoice.getCausalityValueList())\n #LOG(\'causality %s \' %invoice.getCausalityValueList())\n
\n \n
# get a price_currency from the packing list\n # XXX this use of currency is completly bogus, it should be set on simulation movements.\n
related_order = related_packing_list.getDefaultCausalityValue()\n # get a price_currency from the packing list, or the order\n
if related_order is not None:\n price_currency = related_packing_list.getPriceCurrency()\n
if price_currency:\n
invoice.edit(\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 price_currency = related_order.getPriceCurrency()\n
invoice.edit(\n invoice.edit(\n
resource = price_currency,\n resource=price_currency,\n
price_currency = price_currency,\n price_currency=price_currency,)\n
)\n
\n \n
# copy title, if not updating a new delivery\n # copy title, if not updating a new delivery\n
if not invoice.getTitle():\n if not invoice.getTitle():\n
...@@ -113,6 +119,7 @@ if invoice.getSimulationState() == \'draft\':\n ...@@ -113,6 +119,7 @@ if invoice.getSimulationState() == \'draft\':\n
except WorkflowException, e:\n except WorkflowException, e:\n
# The user cannot pass the transition, it\'s OK\n # The user cannot pass the transition, it\'s OK\n
pass\n pass\n
\n
if invoice.getSimulationState() == \'draft\':\n if invoice.getSimulationState() == \'draft\':\n
# call the workflow method, if the user cannot perform this operation.\n # call the workflow method, if the user cannot perform this operation.\n
invoice.plan()\n invoice.plan()\n
...@@ -178,9 +185,9 @@ invoice.activate(\n ...@@ -178,9 +185,9 @@ invoice.activate(\n
<string>LOG</string> <string>LOG</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>related_packing_list</string> <string>related_packing_list</string>
<string>price_currency</string>
<string>related_order</string> <string>related_order</string>
<string>None</string> <string>None</string>
<string>price_currency</string>
<string>e</string> <string>e</string>
</tuple> </tuple>
</value> </value>
......
475 479
\ No newline at end of file \ No newline at end of file
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