Odoo Help


Reset sequence monthly

Herr Alan Paul Stadnik
on 3/14/13, 3:52 PM 5,544 views

Hi, is there a possibility to reset sequences monthly. especially urvhase orders? thx for your ideas


Anas Taji

--Anas Taji--
| 6 7 8
Amman, Jordan
--Anas Taji--

Skype: anas.taji-sw

Email: anas.taji@smartway-jo.com

Anas Taji
On 3/15/13, 7:21 PM

You need to include the month in your sequence and set Implementation to No Gap.

No Gap implementation does not reset sequence number when it comes to the next month.

on 5/3/13, 10:42 AM

This worked for me on earlier version of openERP. however, you are write its not working now. Do you know how to do it?

Smart Way Business Solutions, Anas Taji
on 5/5/13, 9:50 AM
Peregrin Tuk
On 10/17/14, 7:36 PM



Even though the question has been asked long time ago, I'm giving an answer that may be usefull for other users :

I inherited ir.sequence, and overrided _next method in order to reset number_next_actual to 1 if the current year and the last year are not equal (you can replace year by mounth according to your needs), it seems to work fine for me (odoo 9)

class sequence(models.Model):
    _inherit = 'ir.sequence'
last_year = fields.Integer("last",default=1)

def _next(self):
 if thisyear!=self.last_year:
result = super(sequence,self)._next()
return result

Kevin McMenamin

--Kevin McMenamin--

| 5 2 6
Auckland, New Zealand
--Kevin McMenamin--

Kevin McMenamin
On 3/14/13, 4:27 PM

You can certainly set up a sequence that has month as part of the number (e.g PO/Mar13/001). What I am not sure about is if the trailing sequence resets. I can see how you can reset each year under fiscal years.

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 3/14/13, 3:52 PM
Seen: 5544 times
Last updated: 4/19/18, 4:34 AM