I created a sequence for a class. This is the xml structure that create it:
<record id="seq_type_report_review" model="ir.sequence.type">
<field name="name">Report Review</field>
<field name="code">management.reports_review</field>
</record>
<record id="seq_report_review" model="ir.sequence">
<field name="name">Report Review</field>
<field name="code">management.reports_review</field>
<field name="prefix">%(year)s\</field>
<field name="padding">3</field>
<field name="company_id" eval="False"/>
</record>
And this is the system I use to call the sequence in the class:
def create(self, cr, uid, vals, context=None):
vals['review_number'] = self.pool.get('ir.sequence').get(cr, uid, 'management.reports_review') or ''
return super(management_reports_review, self).create(cr, uid, vals, context)
If I create a new voice, the sequence increse by 1. It's ok for me but if I go in the Configuration section the next number voice is always on 1! Why? I would change it but if I change it the sequence go on with is old number.