Commit 8f0f8d08 authored by Vincent Pelletier's avatar Vincent Pelletier

Return earlier if price is None, to avoid trying to round a None value.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17704 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent cba54878
...@@ -72,6 +72,8 @@ commission_price = context.getDiscount()\n ...@@ -72,6 +72,8 @@ commission_price = context.getDiscount()\n
\n \n
if commission_ratio is not None and commission_ratio !=0 and commission_price is not None and commission_price !=0:\n if commission_ratio is not None and commission_ratio !=0 and commission_price is not None and commission_price !=0:\n
price = None\n price = None\n
if price is None:\n
return price\n
if commission_ratio == 0 or commission_price == 0:\n if commission_ratio == 0 or commission_price == 0:\n
price = round(price,0)\n price = round(price,0)\n
if commission_ratio is None and commission_price is None:\n if commission_ratio is None and commission_price is None:\n
...@@ -84,9 +86,6 @@ if commission_ratio is not None:\n ...@@ -84,9 +86,6 @@ if commission_ratio is not None:\n
if commission_price is not None:\n if commission_price is not None:\n
commission_value = commission_price\n commission_value = commission_price\n
\n \n
if price is None:\n
return price\n
\n
quantity = price - commission_value\n quantity = price - commission_value\n
quantity = round(quantity,0)\n quantity = round(quantity,0)\n
if quantity!=context.getQuantity():\n if quantity!=context.getQuantity():\n
......
379 380
\ 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