Odoo Help

Welcome!

This community 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.

0

How to create unique parts serial number

By
Arjun Khode
on 1/19/15, 6:03 AM 668 views

I am working on a module for real estate builder. The builder has multiple sites, and each site has many flats of type 1BHK, 2BHK, etc. Each of these flats are to be sold individually. Now I have to track transactions against each flat. 

My approach is, I've created a product for each type of flat, i.e 1BHK, 2BHK, etc and entered quantity for these.  For example, 10 flats of 1BHK are to be sold.

Now my problem is that I have to create a unique identification for each flat like flat no. B607 and I have to track all the transactions for this specific flat. I'm finding it difficult to create identification for each instance of a product. Can anyone help me with the approach?

I have already tried the following but it did not help

-Creating serial numbers from Traceability in Warehouses, for each product. The serial number can be used again for other instances of the same product but I don't want this. The serial no. needs to be exhaustable. Only one flat can have one serial number. For ex. One flat once sold, can not be made available again, so the serial no. needs to get exhausted.

0
Demirel yakito
On 1/19/15, 7:46 AM

import random

for x in xrange(0,1500,1):
    s=int(random.random()*1000)
    if(s < 10):
        print "B"+str(s*100)

    elif(s < 100):
        print "B"+str(s*10)

    else:
        print "B"+str(s)

 

refer this eg: i created 1500 block no. with three digits.

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 1/19/15, 6:03 AM
Seen: 668 times
Last updated: 3/16/15, 8:10 AM