field auto-increment

Asked by Jose Loureiro

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:
Last query:
Last reply:
Revision history for this message
Best Aksana Ivanova (aksana-ivanova) said :
#1

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

Revision history for this message
Jose Loureiro (miguel-loureiro) said :
#2

Thanks Aksana Ivanova, that solved my question.