Odoo Help


Facing problem getting sequence value. Can any one help me please?

on 9/4/14, 2:12 AM 1,277 views

sequence code

bankreconcile_ref_sequence= self.pool.get('ir.sequence').get(cr, uid, 'bankreconcile_ref_sequence_code'),

sequence output: (u'04 / 09 /2014/10',)

I want to show only 04 / 09 /2014/10 value how can i overcome this?

On 7/5/16, 9:18 AM

use this if you are using odoo v9 

bankreconcile= fields.Char(default=lambda obj:obj.env['ir.sequence'].next_by_code('bankreconcile_model_code'))

and add in sequence.xml in view as


<data noupdate="0">

<record id="seq_autogenerate" model="ir.sequence">

<field name="name">sequence</field>

<field name="code">bankreconcile_model_code</field>

<field name="implementation">standard</field>

<field name="active">TRUE</field>

<field name="prefix">A</field>

<field name="padding">4</field>

<field name="number_increment">1</field>

<field name="number_next_actual">1000</field>




in openerp add 

'data': [ 



On 9/4/14, 2:25 AM

Note from server/openerp/addons/base/ir/ir_sequence.py line 294 and 295 ir_sequence.get() and ir_sequence.get_id() are deprecated. Please use ir_sequence.next_by_code() or ir_sequence.next_by_id().

So you should be writing bankreconcile_ref_sequence= self.pool.get('ir.sequence').next_by_code(cr, uid, 'bankreconcile_ref_sequence_code')

However, if you insist on using get, add the following: bankreconcile_ref_sequence = bankreconcile_ref_sequence and bankreconcile_ref_sequence[0] after the line of code above.


About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 9/4/14, 2:12 AM
Seen: 1277 times
Last updated: 7/5/16, 9:18 AM