From 38577e23f4851ad624c0b5b23a1c170a98ce8168 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Fri, 7 Feb 2014 09:40:00 +0100 Subject: [PATCH] [IMP] stock, usability: changed a button label and translate the information on availability of moves into the move uom bzr revid: qdp-launchpad@openerp.com-20140207084000-k7uhl82v9mlmuc92 --- addons/stock/stock.py | 7 +++++-- addons/stock/stock_view.xml | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index d3c89b0c251..4ee6f3a926b 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -1303,23 +1303,26 @@ class stock_move(osv.osv): def _get_string_qty_information(self, cr, uid, ids, field_name, args, context=None): settings_obj = self.pool.get('stock.config.settings') + uom_obj = self.pool.get('product.uom') res = dict.fromkeys(ids, '') for move in self.browse(cr, uid, ids, context=context): if move.state in ('draft', 'done', 'cancel') or move.location_id.usage != 'internal': res[move.id] = _('n/a') continue total_available = min(move.product_qty, move.reserved_availability + move.availability) + total_available = uom_obj._compute_qty(cr, uid, move.product_id.uom_id.id, total_available, move.product_uom.id) info = str(total_available) #look in the settings if we need to display the UoM name or not config_ids = settings_obj.search(cr, uid, [], limit=1, order='id DESC', context=context) if config_ids: stock_settings = settings_obj.browse(cr, uid, config_ids[0], context=context) if stock_settings.group_uom: - info += ' ' + move.product_id.uom_id.name + info += ' ' + move.product_uom.name if move.reserved_availability: if move.reserved_availability != total_available: #some of the available quantity is assigned and some are available but not reserved - info += _(' (%s reserved)') % str(move.reserved_availability) + reserved_available = uom_obj._compute_qty(cr, uid, move.product_id.uom_id.id, move.reserved_availability, move.product_uom.id) + info += _(' (%s reserved)') % str(reserved_available) else: #all available quantity is assigned info += _(' (reserved)') diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml index 0afe8f8df34..303785da294 100644 --- a/addons/stock/stock_view.xml +++ b/addons/stock/stock_view.xml @@ -754,8 +754,8 @@