Commit e2f4550e authored by Arnaud Fontaine's avatar Arnaud Fontaine

Fix issue on stock listbox when there is no unit conversion defined.

parent 15cfefa0
......@@ -64,11 +64,16 @@ def getOrderStr(movement_list, resource_value):\n
order_str += \'%s%.f%s\' % (movement_idx and \', \' or \'\', quantity,\n
quantity_unit_value.getShortTitle())\n
\n
sum_quantity += resource_value.convertQuantity(quantity,\n
converted_quantity = resource_value.convertQuantity(quantity,\n
movement.getQuantityUnit(),\n
resource_value.getDefaultQuantityUnit())\n
\n
if movement_idx > 0:\n
if converted_quantity:\n
sum_quantity += converted_quantity\n
\n
if not sum_quantity:\n
return None\n
elif movement_idx > 0:\n
order_str += \' \' + context.Base_translateString(\'(${quantity}${quantity_unit} total)\',\n
mapping={\'quantity\': sum_quantity,\n
\'quantity_unit\': resource_value.getShortTitle()})\n
......@@ -110,8 +115,12 @@ if movement_dict:\n
getAvailableInventory=str,\n
inventory=\'\')\n
\n
order_dict[movement.getUid()] = getOrderStr([movement], resource_value)\n
line_list.append(temp_movement)\n
order_str = getOrderStr([movement], resource_value)\n
if not order_str:\n
continue\n
\n
order_dict[movement.getUid()] = order_str\n
\n
context.REQUEST.set(\'order_dict\', order_dict)\n
\n
......
2011-06-02 arnaud.fontaine
* Fix issue on stock listbox when there is no unit conversion defined.
2011-05-27 arnaud.fontaine
* Fix stock listbox and add a new column 'order'.
......
1126
\ No newline at end of file
1127
\ 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