This question has been flagged

I have an object with a sequence that is updated in the create() method. I ran into an odd problem today, when I was importing data:

To illustrate, my next number in the sequence was 50. And lets say I was importing 75 records.

  1. I ran the import wizard, clicked validate. Everything was good.
  2. Import the data. Success.
  3. Check the assigned sequence: They were 125-200 instead of the expected 50-125!

So clearly, the import validation button is actually running the create() method? Then deleting the results? If this is the case, is there a way I could check the context to make sure that If the import validation is running that I do NOT assign a sequence number? Anyone run into this problem before?

Avatar
Discard
Best Answer

If you have the column "id" mapped properly the sequence will be preserved, items without a sequence will be flagged.

also, if you have imported things and deleted them, those sequence numbers will not be reclaimed, number will start with the last highest.

if you have id - name 1 - A 2 - B 3 - C < delete this

and then you import more stuff number will start at 4. 1 - A 2 - B 4 - D 5 - E

if you have id - name 1 - A 2 - B 3 - C < delete this

and then you import this: id - name 3 - D 4 - E

you would end up with 1 - A 2 - B 3 - D 4 - E

Avatar
Discard
Author

Thank you for your answer. However, I still a bit confused. What exactly do you meanby mapping the column id? I'm importing new products, and thus NOT using an external_id column in the import. When openerp sees this, it simply adds a new product for me. Please, could you be a little more specific? Thanks again!

Author

Actually, THANKS!! I had to change the sequence entry to be "No Gap".

glad it worked for you.