Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
1 Beantwoorden
5725 Weergaven

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
Annuleer
Beste antwoord

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
Annuleer
Auteur

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!

Auteur

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

glad it worked for you.

Gerelateerde posts Antwoorden Weergaven Activiteit
4
mrt. 15
8558
1
aug. 24
1491
4
nov. 23
31896
5
apr. 18
8339
12
jan. 17
14229