[Fix] stock: Fix the problem in copy method of picking
bzr revid: sbh@tinyerp.com-20100528073754-gy7j0ecboxdj86yp
This commit is contained in:
parent
544b2cf1dd
commit
eb13ea9ea3
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue