Commit 6d7d5def authored by Łukasz Nowak's avatar Łukasz Nowak

- microoptimisation and make script more issue resistant

Sometimes cell.getContributionShare can return None. This script fails,
as it is not possible to add None with script. Thanks to this change
script will not fail in (possibly) wrongly configured environment.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@31928 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d0389e21
......@@ -119,9 +119,10 @@ for paysheet_line in paysheet_line_list:\n
\n
base = cell.getQuantity()\n
\n
share_dict[cell.getContributionShare()+\'_price\'] = cell.getPrice()\n
share_dict[cell.getContributionShare()+\'_quantity\'] = cell.getQuantity()\n
share_dict[cell.getContributionShare()+\'_total_price\'] = \\\n
cell_contribution_share = cell.getContributionShare() or \'\'\n
share_dict[cell_contribution_share+\'_price\'] = cell.getPrice()\n
share_dict[cell_contribution_share+\'_quantity\'] = cell.getQuantity()\n
share_dict[cell_contribution_share+\'_total_price\'] = \\\n
round(cell.getTotalPrice(), precision)\n
\n
tuple_dict = {}\n
......@@ -294,6 +295,7 @@ return line_list\n
<string>share_dict</string>
<string>cell</string>
<string>base</string>
<string>cell_contribution_share</string>
<string>_write_</string>
<string>round</string>
<string>tuple_dict</string>
......
540
\ No newline at end of file
541
\ 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