From eb13ea9ea3f0eb52dca20eea4796376f89df321f Mon Sep 17 00:00:00 2001 From: "sbh (Open ERP)" Date: Fri, 28 May 2010 13:07:54 +0530 Subject: [PATCH] [Fix] stock: Fix the problem in copy method of picking bzr revid: sbh@tinyerp.com-20100528073754-gy7j0ecboxdj86yp --- addons/stock/stock.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 635231fcca5..fdbd1eba242 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -540,8 +540,10 @@ class stock_picking(osv.osv): if default is None: default = {} default = default.copy() - if not default.get('name',False): - default['name'] = self.pool.get('ir.sequence').get(cr, uid, 'stock.picking') + picking_obj = self.browse(cr, uid, [id], context)[0] + if ('name' not in default) or (picking_obj.get('name')=='/'): + seq_obj_name = 'stock.picking.' + picking_obj.type + default['name'] = self.pool.get('ir.sequence').get(cr, uid, seq_obj_name) return super(stock_picking, self).copy(cr, uid, id, default, context) def onchange_partner_in(self, cr, uid, context, partner_id=None):