From dc62d65efab276497d6021cdb5f7a333ea7efe6c Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Sun, 4 Aug 2013 02:43:03 +0200 Subject: [PATCH] [IMP] stock: name_Get of stock.production.lot now also shows the partner (if any) bzr revid: qdp-launchpad@openerp.com-20130804004303-h6jcpka0xvqplov3 --- addons/stock/stock.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index d66c318cb81..a6cd65d8666 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -813,6 +813,15 @@ class stock_production_lot(osv.osv): _sql_constraints = [ ('name_ref_uniq', 'unique (name, ref)', 'The combination of Serial Number and internal reference must be unique !'), ] + def name_get(self, cr, uid, ids, context=None): + res = [] + for lot in self.browse(cr, uid, ids, context=context): + name = lot.name + if lot.partner_id: + name += ' (' + lot.partner_id.name + ')' + res.append((lot.id, name)) + return res + # ----------------------------------------------------