İçereği Atla
Menü
Bu soru işaretlendi
1 Cevapla
5727 Görünümler

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
Vazgeç
En İyi Yanıt

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
Vazgeç
Üretici

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!

Üretici

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

glad it worked for you.

İlgili Gönderiler Cevaplar Görünümler Aktivite
4
Mar 15
8559
1
Ağu 24
1493
4
Kas 23
31899
5
Nis 18
8340
12
Oca 17
14230