how to create dynamic sequence number and moreover i wanna generate last two digits of year in prefix, like 2019 is 19 only
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
not working Haresh
Try this:
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<record id="seq_demo" model="ir.sequence">
<field name="name">Sequence Name</field>
<field name="code">demo_seq</field>
<field name="padding">7</field>
<field name="prefix">%(y)s</field>
<field name="number_increment">1</field>
<field name="number_next_actual">1</field>
</record>
</data>
</odoo>
ok thank you haresh
Hi Varada,
You can chose full or only digit of year as prefix, please see the screenshot for each.
for two digit in year as prefix do the following,
For four digit in year as prefix do the following,
If you want to reset sequence when the year is changed, you need to chose range per flag and need to define the no of year with date range. and next sequence number of that year. so whenever that year will be present sequence will taken from there as next sequence.
Please upvote and correct the answer if you it gives your answers.
Hope this may help you a little or give you hint how to do it.
Best Regards,
Haresh Kansara.
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up
Creating dynamic sequence number: https://learnopenerp.blogspot.com/2020/08/generate-create-sequence-number-odoo.html