Skip to Content
Menu
This question has been flagged
5 Replies
6009 Views

how to create dynamic sequence number and moreover i wanna generate last two digits of year in prefix, like 2019 is 19 only

Avatar
Discard
Author Best Answer

not working Haresh

Avatar
Discard

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>

Author

ok thank you haresh

Best Answer

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.

Avatar
Discard