[FIX] stock

bzr revid: fp@tinyerp.com-20130730075131-4etoby9sorxf1dby
This commit is contained in:
Fabien Pinckaers
2013-07-30 09:51:31 +02:00
parent a70fd162ce
commit bf7f51ecaa
+2 -1
View File
@@ -394,7 +394,8 @@ class stock_picking(osv.osv):
def create(self, cr, user, vals, context=None):
context = context or {}
if ('name' not in vals) or (vals.get('name') in ('/', False)):
ptype_id = vals.get('picking_type_id', context['default_picking_type_id'])
print 'Picking Vals', vals, context
ptype_id = vals.get('picking_type_id', context.get('picking_type_id', False))
sequence_id = self.pool.get('stock.picking.type').browse(cr, user, ptype_id, context=context).sequence_id.id
vals['name'] = self.pool.get('ir.sequence').get_id(cr, user, sequence_id, 'id', context=context)
return super(stock_picking, self).create(cr, user, vals, context)