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

Handle the case where inventory_brain.total_price is None

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@16504 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e18f3f7a
...@@ -85,6 +85,7 @@ def roundCurrency(value, resource_relative_url):\n ...@@ -85,6 +85,7 @@ def roundCurrency(value, resource_relative_url):\n
qty_precision = precision_cache[resource_relative_url]\n qty_precision = precision_cache[resource_relative_url]\n
return round(value, qty_precision)\n return round(value, qty_precision)\n
\n \n
\n
at_date = context.getStopDate()\n at_date = context.getStopDate()\n
assert at_date\n assert at_date\n
\n \n
...@@ -175,8 +176,8 @@ for inventory in getInventoryList(\n ...@@ -175,8 +176,8 @@ for inventory in getInventoryList(\n
group_by_resource=1,\n group_by_resource=1,\n
**inventory_param_dict):\n **inventory_param_dict):\n
\n \n
total_price = roundCurrency(inventory.total_price, section_currency)\n total_price = roundCurrency(inventory.total_price or 0, section_currency)\n
quantity = roundCurrency(inventory.total_quantity,\n quantity = roundCurrency(inventory.total_quantity or 0,\n
inventory.resource_relative_url)\n inventory.resource_relative_url)\n
profit_and_loss_quantity += total_price\n profit_and_loss_quantity += total_price\n
\n \n
...@@ -206,8 +207,8 @@ for inventory in getInventoryList(\n ...@@ -206,8 +207,8 @@ for inventory in getInventoryList(\n
group_by_resource=1,\n group_by_resource=1,\n
**inventory_param_dict):\n **inventory_param_dict):\n
\n \n
total_price = roundCurrency(inventory.total_price, section_currency)\n total_price = roundCurrency(inventory.total_price or 0, section_currency)\n
quantity = roundCurrency(inventory.total_quantity,\n quantity = roundCurrency(inventory.total_quantity or 0,\n
inventory.resource_relative_url)\n inventory.resource_relative_url)\n
profit_and_loss_quantity += total_price\n profit_and_loss_quantity += total_price\n
\n \n
......
409 411
\ 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