field auto-increment

Asked by Jose Loureiro on 2013-11-25

i have a class sncp_despesa_compromisso_linha that has the following fields:
'compromisso_ano_id':fields.many2one('sncp.despesa.compromisso.ano',u'Compromisso Anual'),
'linha':fields.integer(u'Linha'),
and other fields.
i have also a class sncp_despesa_compromisso_ano that is related to this class. My idea is to put field linha of class sncp_despesa_compromisso_linha auto-increment, this is, fills automatically the field linha with number 1,2,3,....,etc.
i need to overwrite function create of class sncp_despesa_compromisso_linha? How can i do that?
i need to change xml file? How can i do that?
How can i create a ir.sequence object?
Thanks,
José

Question information

Language:
English Edit question
Status:
Solved
For:
Odoo Addons (MOVED TO GITHUB) Edit question
Assignee:
No assignee Edit question
Solved by:
Aksana Ivanova
Solved:
2013-11-29
Last query:
2013-11-29
Last reply:
2013-11-29

You have to create sequence, which you call every time when you create the field.
check this page
http://forum.openerp.com/forum/topic28781.html

Thanks Aksana Ivanova, that solved my question.