Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
5734 Visualizzazioni

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
Abbandona
Risposta migliore

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
Abbandona
Autore

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!

Autore

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

glad it worked for you.

Post correlati Risposte Visualizzazioni Attività
4
mar 15
8562
1
ago 24
1495
4
nov 23
31905
5
apr 18
8341
12
gen 17
14231