From 75bbbead3e187c2a441292e0befab0562905cbcc Mon Sep 17 00:00:00 2001 From: Giovanni Francesco Capalbo Date: Tue, 25 Feb 2020 14:09:14 +0100 Subject: [PATCH] [FIX] do not use deprecated ir_sequence.get , but ir_sequence.next_by_code --- mro/mro.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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: