Skip to Content
Menu
This question has been flagged
1 Reply
2265 Views

Hi , I'm trying to increment a field by 1 , but it is incremented by 2. here is my code:

patient.py

Num_dossier = fields.Char('Numéro du dossier', required=True, readonly=True)

_defaults = {       

lambda self,cr,uid,context={}: self.pool.get('ir.sequence').get(cr, uid, 'numero.dossier'),         

}


my_sequence.xml

<record model="ir.sequence.type" id="seq_type_patient">           

    <field name="name">patient_sequence</field>           

    <field name="code">numero.dossier</field>       

</record>       

<record id="seq_patient" model="ir.sequence">           

    <field name="name">patient</field>            

    <field name="code">numero.dossier</field>                        

    <field name="number_increment">1</field>       

</record>

Avatar
Discard
Author Best Answer

Probleme solved by using id = fields.Integer() only.

Avatar
Discard
Related Posts Replies Views Activity
1
Aug 23
12544
1
Aug 23
11039
1
Jul 23
7219
4
Apr 23
8675
2
Feb 23
17589