Commit 696bc0d2 authored by Yoshinori Okuji's avatar Yoshinori Okuji

2009-02-06 yo

* Stop raising an exception, even if the credit is not equal to the debit in a built delivery, in the post processing script, because the builder may not blindly adopt prevision when updating existing lines, thus it can be unbalanced.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@25468 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 60339a0c
...@@ -72,12 +72,15 @@ for line in line_list:\n ...@@ -72,12 +72,15 @@ for line in line_list:\n
line.setQuantity(line_quantity)\n line.setQuantity(line_quantity)\n
total_quantity += line_quantity\n total_quantity += line_quantity\n
\n \n
# total_quantity should be 0, or we created a transaction where debit != credit\n # The total quantity should be zero with a little error, if simulation has been\n
# completely applied, because the debit and the credit must be balanced. However,\n
# this is not the case, if the delivery is divergent, as the builder does not\n
# adopt prevision automatically, when a conflict happens between the simulation\n
# and user-entered values.\n
if abs(round(total_quantity, precision)) > 2 * resource.getBaseUnitQuantity():\n if abs(round(total_quantity, precision)) > 2 * resource.getBaseUnitQuantity():\n
raise ValueError, \'debit != credit for %s => %s\' % (\n return\n
context.getPath(), total_quantity)\n
\n \n
# if the difference is <= the base quantity unit, we round the last line\n # if the difference is <= the base quantity unit, we round the last line.\n
if line is not None:\n if line is not None:\n
line.setQuantity(round(line.getQuantity() - total_quantity, precision))\n line.setQuantity(round(line.getQuantity() - total_quantity, precision))\n
...@@ -131,7 +134,6 @@ if line is not None:\n ...@@ -131,7 +134,6 @@ if line is not None:\n
<string>line_quantity</string> <string>line_quantity</string>
<string>_inplacevar_</string> <string>_inplacevar_</string>
<string>abs</string> <string>abs</string>
<string>ValueError</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
2009-02-06 yo
* Stop raising an exception, even if the credit is not equal to the debit in a built delivery, in the post processing script, because the builder may not blindly adopt prevision when updating existing lines, thus it can be unbalanced.
2008-11-13 yusei 2008-11-13 yusei
* Start to develop version 5.4. * Start to develop version 5.4.
......
859 861
\ 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