From bc1e862a85047d71bd7e0697654f5fa77ce76502 Mon Sep 17 00:00:00 2001 From: "vra (Tiny)" Date: Wed, 3 Jun 2009 18:34:57 +0530 Subject: [PATCH] Update the branch with latest stable addons. bzr revid: vinusoft85@gmail.com-20090603130457-euf0dbo08r1hg9ko --- addons/stock/i18n/fr_FR.po | 2 +- addons/stock/stock.py | 32 ++++++++++++++---------- addons/stock/wizard/wizard_track_line.py | 1 + 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/addons/stock/i18n/fr_FR.po b/addons/stock/i18n/fr_FR.po index c29692013f5..62620e27b49 100644 --- a/addons/stock/i18n/fr_FR.po +++ b/addons/stock/i18n/fr_FR.po @@ -1796,7 +1796,7 @@ msgstr "Magasin" #: selection:stock.move,state:0 #: selection:stock.picking,state:0 msgid "Done" -msgstr "Terminer" +msgstr "Terminé" #. module: stock #: model:stock.location,name:stock.stock_location_locations_virtual diff --git a/addons/stock/stock.py b/addons/stock/stock.py index dd5f0a89fc9..a95234a7c61 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -785,20 +785,26 @@ class stock_production_lot(osv.osv): if 'location_id' not in context: locations = self.pool.get('stock.location').search(cr, uid, [('usage','=','internal')], context=context) else: - locations = [context['location_id']] + locations = context['location_id'] and [context['location_id']] or [] + + if isinstance(ids, (int, long)): + ids = [ids] + res = {}.fromkeys(ids, 0.0) - cr.execute('''select - prodlot_id, - sum(name) - from - stock_report_prodlots - where - location_id in ('''+','.join(map(str, locations))+''') and - prodlot_id in ('''+','.join(map(str, ids))+''') - group by - prodlot_id - ''') - res.update(dict(cr.fetchall())) + + if locations: + cr.execute('''select + prodlot_id, + sum(name) + from + stock_report_prodlots + where + location_id in ('''+','.join(map(str, locations))+''') and + prodlot_id in ('''+','.join(map(str, ids))+''') + group by + prodlot_id + ''') + res.update(dict(cr.fetchall())) return res def _stock_search(self, cr, uid, obj, name, args): diff --git a/addons/stock/wizard/wizard_track_line.py b/addons/stock/wizard/wizard_track_line.py index 009282450bb..1aeeb0ad215 100644 --- a/addons/stock/wizard/wizard_track_line.py +++ b/addons/stock/wizard/wizard_track_line.py @@ -77,6 +77,7 @@ def _track_lines(self, cr, uid, data, context): 'product_uos_qty': uos_qty, } new_move = [] + production_ids = [] for idx in range(int(move.product_qty//quantity)): if idx: current_move = move_obj.copy(cr, uid, move.id, {'state': move.state, 'production_id': move.production_id.id})