Skip to content
Snippets Groups Projects
Commit 442bba25 authored by Quentin De Paoli's avatar Quentin De Paoli
Browse files

[FIX] bugfixed problem of ir.sequence on stock.picking name (missing numbers)

[IMP] name is not copied anymore when a stock.picking is beeing copied

bzr revid: qdp@tinyerp.com-20090205164133-k758rjmdrr0kcghr
parent 39f483b8
No related branches found
No related tags found
No related merge requests found
...@@ -397,7 +397,7 @@ class stock_picking(osv.osv): ...@@ -397,7 +397,7 @@ class stock_picking(osv.osv):
_columns = { _columns = {
'name': fields.char('Reference', size=64, required=True, select=True), 'name': fields.char('Reference', size=64, select=True),
'origin': fields.char('Origin Reference', size=64), 'origin': fields.char('Origin Reference', size=64),
'backorder_id': fields.many2one('stock.picking', 'Back Order'), 'backorder_id': fields.many2one('stock.picking', 'Back Order'),
'type': fields.selection([('out','Sending Goods'),('in','Getting Goods'),('internal','Internal'),('delivery','Delivery')], 'Shipping Type', required=True, select=True), 'type': fields.selection([('out','Sending Goods'),('in','Getting Goods'),('internal','Internal'),('delivery','Delivery')], 'Shipping Type', required=True, select=True),
...@@ -432,7 +432,7 @@ class stock_picking(osv.osv): ...@@ -432,7 +432,7 @@ class stock_picking(osv.osv):
select=True, required=True, readonly=True, states={'draft':[('readonly',False)]}), select=True, required=True, readonly=True, states={'draft':[('readonly',False)]}),
} }
_defaults = { _defaults = {
'name': lambda self,cr,uid,context: self.pool.get('ir.sequence').get(cr, uid, 'stock.picking'), #'name': lambda self,cr,uid,context: self.pool.get('ir.sequence').get(cr, uid, 'stock.picking'),
'active': lambda *a: 1, 'active': lambda *a: 1,
'state': lambda *a: 'draft', 'state': lambda *a: 'draft',
'move_type': lambda *a: 'direct', 'move_type': lambda *a: 'direct',
...@@ -440,9 +440,12 @@ class stock_picking(osv.osv): ...@@ -440,9 +440,12 @@ class stock_picking(osv.osv):
'invoice_state': lambda *a: 'none', 'invoice_state': lambda *a: 'none',
'date': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'), 'date': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'),
} }
#def copy(self, cr, uid, id, data=None, context={}): def copy(self, cr, uid, id, default=None, context={}):
# data = data or {} if default is None:
# return super(stock_picking, self).copy(cr, uid, id, data, context) default = {}
default = default.copy()
default['name'] = False
return super(stock_picking, self).copy(cr, uid, id, default, context)
def onchange_partner_in(self, cr, uid, context, partner_id=None): def onchange_partner_in(self, cr, uid, context, partner_id=None):
return { } return { }
...@@ -451,7 +454,8 @@ class stock_picking(osv.osv): ...@@ -451,7 +454,8 @@ class stock_picking(osv.osv):
return moves return moves
def action_confirm(self, cr, uid, ids, context={}): def action_confirm(self, cr, uid, ids, context={}):
self.write(cr, uid, ids, {'state': 'confirmed'}) val = self.pool.get('ir.sequence').get(cr, uid, 'stock.picking')
self.write(cr, uid, ids, {'name': val, 'state': 'confirmed'})
todo = [] todo = []
for picking in self.browse(cr, uid, ids): for picking in self.browse(cr, uid, ids):
for r in picking.move_lines: for r in picking.move_lines:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment