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?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
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?
use this if you are using odoo v9
bankreconcile= fields.Char(default=lambda obj:obj.env['ir.sequence'].next_by_code('bankreconcile_model_code')) |
<openerp> <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> </record> </data> </openerp> |
'data': [ 'view/sequence.xml', ], |
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.
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up