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