diff --git a/addons/account/invoice.py b/addons/account/invoice.py index b5313b09673..bb2dca8b3b3 100644 --- a/addons/account/invoice.py +++ b/addons/account/invoice.py @@ -178,6 +178,7 @@ class account_invoice(osv.osv): move[line.move_id.id] = True for line in r.line_id: move[line.move_id.id] = True + invoice_ids = [] if move: invoice_ids = self.pool.get('account.invoice').search(cr, uid, [('move_id','in',move.keys())], context=context) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 7de9cf69b35..9285143c69e 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -395,6 +395,10 @@ class stock_picking(osv.osv): res[pick]['max_date'] = dt2 return res + def create(self, cr, user, vals, context=None): + if 'name' not in vals: + vals['name'] = self.pool.get('ir.sequence').get(cr, user, 'stock.picking') + return super(stock_picking, self).create(cr, user, vals, context) _columns = { 'name': fields.char('Reference', size=64, select=True), @@ -432,7 +436,7 @@ class stock_picking(osv.osv): select=True, required=True, readonly=True, states={'draft':[('readonly',False)]}), } _defaults = { - 'name': lambda self,cr,uid,context: self.pool.get('ir.sequence').get(cr, uid, 'stock.picking'), + 'name': lambda self,cr,uid,context: '/', 'active': lambda *a: 1, 'state': lambda *a: 'draft', 'move_type': lambda *a: 'direct',