Odoo Help


This community 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.


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

on 9/4/14, 2:12 AM 751 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': [ 





| 5 3 6
Jakarta, Indonesia
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.


Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)


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