Odoo Help

0

production lot number creation

By
kaynis
on 5/22/13, 2:34 PM 1,342 views

Hi All, Using V6.1 on windows I basically want to design a class or function in an existing module, probably the stock module, that would allow the system to create production lot number based on the current date and number of production lot that has been created on that day. I have written a code that I think would do the job but I do not know where exactly to put it. The python code is below which is quite simple. This is to make tracking of product even easier for the company and employees

currentid=None;

#currentid='1130206'

if currentid==None or currentid=='':

   currentid='1'+time.strftime('%y%d%m')

else:

   idpart=currentid[0:-6];

datepart=currentid[1:];

#print (idpart)

#print (datepart)

idpartint=int(idpart)

if time.strftime('%y%d%m')==datepart:

    currentid=str(idpartint+1)+datepart

else:

    currentid='1'+time.strftime('%y%d%m')

#print (currentid)

prodt_lot = currentid

the series should look something like 1132205,2132205...x132205 for the 22May2013 then the next day should start from 1 again looking like this 1132305,2132305...x132305 etc as oppose to the current seven digit number e.g 0000007 generated by the system

Thank you.
Can anyone help please?

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.

Register

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

0 follower(s)

Stats

Asked: 5/22/13, 2:34 PM
Seen: 1342 times
Last updated: 3/16/15, 8:10 AM