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


I need to create new records who need to have a specific ID. For
example, a new product.template with the ID 2. The prolem is that the
create() method from the ORM create my new record with anothed ID that
the one I give him as values.

Is it possible, with the Odoo ORM API, to create records with a
specific ID or do I need to do SQL?



Avatar
Abbandona
Risposta migliore

You should use the External ID for that purpose.

Avatar
Abbandona
Autore

Based on this: https://www.odoo.com/documentation/master/glossary.html#term-external-id

External ID is completely different to id field. Not what I need.

Autore

thanks anyway ;)

I know, but you should never touch the internal ID in any system.

twanda AG
Ermin Trevisan
Artherstrasse 19
CH-6318 Walchwil
T +41 41 758 1515
M +41 79 208 7373

On 11 Jun 2019, at 09:15, Sebastien G <sebastien.gendre@hasa.ch> wrote:

thanks anyway ;)

Sent by Odoo S.A. using Odoo.

Post correlati Risposte Visualizzazioni Attività
5
gen 24
12636
1
mar 15
9397
0
mar 15
4657
1
giu 18
3498
4
gen 17
8043