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?
คำถามนี้ถูกตั้งค่าสถานะ
1
ตอบกลับ
7202
มุมมอง
You should use the External ID for that purpose.
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.
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
สนุกกับการพูดคุยนี้ใช่ไหม? เข้าร่วมเลย!
สร้างบัญชีวันนี้เพื่อเพลิดเพลินไปกับฟีเจอร์พิเศษและมีส่วนร่วมกับคอมมูนิตี้ที่ยอดเยี่ยมของเรา!
ลงชื่อ| Related Posts | ตอบกลับ | มุมมอง | กิจกรรม | |
|---|---|---|---|---|
|
Hot to get the current id into a method
แก้ไขแล้ว
|
|
5
ม.ค. 24
|
13889 | |
|
|
1
มี.ค. 15
|
11286 | ||
|
|
0
มี.ค. 15
|
6615 | ||
|
|
1
ก.ค. 20
|
32 | ||
|
|
1
มิ.ย. 18
|
5088 |