Skip to Content
Menu
This question has been flagged
2 Replies
1291 Views

I created a database with multiple users. I want to set the number series of the payment voucher for each user should be different. Can I do that ? 

Avatar
Discard
Best Answer

Hi Shanan,

In Odoo already is a model "coupon. coupon" which generate a random number you can take reference like that:

import random

@api.model

def _generate_code(self):

return str(random.getrandbits(64))

code = fields.Char(default=_generate_code, required=True, readonly=True)

Thanks

Regards,




Email:      odoo@aktivsoftware.com  

Skype: kalpeshmaheshwari

   


Avatar
Discard
Best Answer

create one field
create a sequence and apply on field

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

            <field name="name">payment sequence</field>

            <field name="code">module.name</field>

            <field name="prefix">A</field>

            <field eval="1" name="number_next"/>

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

            <field eval="False" name="company_id"/>

        </record>

Avatar
Discard
Related Posts Replies Views Activity
1
May 24
1433
1
Apr 24
23256
1
Nov 22
1403
2
Jul 22
1803
2
Jul 22
1825