diff --git a/mro/mro.py b/mro/mro.py index 96b41c32..e18e551a 100644 --- a/mro/mro.py +++ b/mro/mro.py @@ -175,7 +175,7 @@ def test_ready(self, cr, uid, ids): if any(states) or len(states) == 0: res = False return res - def action_confirm(self, cr, uid, ids, context=None): + def action_confirm(self, cr, uid, ids, context=None): """ Confirms maintenance order. @return: True """ @@ -247,7 +247,8 @@ def force_parts_reservation(self, cr, uid, ids, context=None): def create(self, cr, uid, vals, context=None): if vals.get('name','/')=='/': - vals['name'] = self.pool.get('ir.sequence').get(cr, uid, 'mro.order') or '/' + vals['name'] = self.pool.get('ir.sequence').next_by_code( + cr, uid, 'mro.order') or '/' return super(mro_order, self).create(cr, uid, vals, context=context) def write(self, cr, uid, ids, vals, context=None): @@ -480,7 +481,8 @@ def action_cancel(self, cr, uid, ids, context=None): def create(self, cr, uid, vals, context=None): if vals.get('name','/')=='/': - vals['name'] = self.pool.get('ir.sequence').get(cr, uid, 'mro.request') or '/' + vals['name'] = self.pool.get('ir.sequence').next_by_code( + cr, uid, 'mro.request') or '/' return super(mro_request, self).create(cr, uid, vals, context=context) -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: