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 ?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project management
- MRP
This question has been flagged
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
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>
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
|
1
May 24
|
1433 | ||
|
1
Apr 24
|
23256 | ||
|
1
Nov 22
|
1403 | ||
|
2
Jul 22
|
1803 | ||
|
2
Jul 22
|
1825 |