[IMP] stock: name_Get of stock.production.lot now also shows the partner (if any)

bzr revid: qdp-launchpad@openerp.com-20130804004303-h6jcpka0xvqplov3
This commit is contained in:
Quentin (OpenERP) 2013-08-04 02:43:03 +02:00
parent 8310ef808c
commit dc62d65efa
1 changed files with 9 additions and 0 deletions

View File

@ -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
# ----------------------------------------------------