跳至內容
Odoo 選單
  • 登入
  • 免費試用
  • 應用程式
    財政
    • 會計
    • 發票
    • 開支報銷
    • 試算表 (BI)
    • 文件管理
    • 電子簽名
    銷售
    • 客戶關係
    • 銷售
    • POS 銷售點管理 - 零售
    • POS 銷售點管理 - 餐廳
    • 訂閱
    • 租賃
    網站
    • 網站製作
    • 電子商務
    • 網誌
    • 討論區
    • 線上客服
    • 網上學習
    供應鏈
    • 庫存
    • 製造管理
    • 產品生命周期
    • 採購
    • 保養維護
    • 品質管理
    人力資源
    • 員工管理
    • 招聘
    • 休假
    • 工作表現評核
    • 內部推薦
    • 車隊管理
    市場推廣
    • 社交媒體推廣
    • 電郵推廣
    • 短訊營銷
    • 活動
    • 自動化推廣
    • 網上調查
    服務
    • 專案管理
    • 工時管理
    • 外勤服務管理
    • 技術支援
    • 工作規劃
    • 預約管理
    生產力
    • 聊天
    • 批核
    • 物聯網
    • VoIP
    • 知識庫
    • WhatsApp
    第三方應用程式 Odoo Studio Odoo 雲端平台
  • 行業
    零售
    • 書店
    • 服裝店
    • 家具店
    • 食品雜貨店
    • 五金店
    • 玩具店
    餐飲及款待
    • 酒吧及酒館
    • 餐廳
    • 快餐
    • 賓館
    • 飲品分銷商
    • 酒店
    房地產
    • 地產代理公司
    • 建築師事務所
    • 建造業
    • 物業管理
    • 園藝
    • 業主聯會
    顧問服務
    • 會計公司
    • Odoo 合作夥伴
    • 市場推廣公司
    • 律師事務所
    • 人才招募
    • 審計及認證
    製造管理
    • 紡織
    • 金屬
    • 家具
    • 食品
    • 啤酒廠
    • 企業禮品
    保健與健身
    • 運動俱樂部
    • 眼鏡店
    • 健身中心
    • 健康從業人員
    • 藥房
    • 髮型屋
    技術行業
    • 雜工
    • IT 硬體與支援
    • 太陽能系統
    • 鞋匠
    • 清潔服務
    • 暖通空調服務
    其他
    • 非牟利組織
    • 環境保護機構
    • 廣告板租賃
    • 攝影服務
    • 自行車租賃
    • 軟體經銷商
    瀏覽所有行業
  • 社群
    學習
    • 教學影片
    • 使用說明
    • 認證
    • 培訓
    • 網誌
    • Podcast
    增強教學效能
    • 教育計劃
    • Scale Up! 商業遊戲
    • 到訪 Odoo
    取得軟件
    • 下載
    • 版本對照表
    • 版本說明
    合作
    • GitHub
    • 討論區
    • 活動
    • 翻譯
    • 成為合作夥伴
    • 合作夥伴服務
    • 登記你的會計服務公司
    獲取服務相關資料
    • 尋找合作夥伴
    • 尋找會計服務
    • 預約顧問諮詢
    • 安裝及推行服務
    • 客戶案例
    • 支援
    • 軟件升級
    GitHub YouTube Twitter LinkedIn Instagram Facebook Spotify
    +1 (650) 691-3277
    預約示範
  • 定價
  • 技術支援

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • 客戶關係
  • e-Commerce
  • 會計
  • 庫存
  • PoS
  • 專案管理
  • MRP
All apps
只限註冊用戶才可與社群互動。
所有帖文 人 獎章
標籤 (查看所有)
odoo accounting v14 pos v15
關於此討論區
只限註冊用戶才可與社群互動。
所有帖文 人 獎章
標籤 (查看所有)
odoo accounting v14 pos v15
關於此討論區
支援

Unique external and internal product values in Odoo 10

訂閱

此帖文有活動時,接收通知

此問題已被標幟
11 回覆
8150 瀏覽次數
頭像
J C

Hi Odoo community, I have quite a specific question regarding the unique values Odoo assigns to products created (for example __export__.product_template_ and internal IDs)

We always start with our main Excel file where we keep all our data updated. From there we import products, their characteristics, prices, and later quantities in Odoo. When importing, Odoo assigns a unique ID to every single product. That means if we import 1000 articles Odoo will generate 1000 unique IDs. 

What I wonder is how these IDs are used through Odoo and the sale process. We mostly use POS for sales so what if an item from within our 1000 products list is sold and processed through the invoice system (for example Products => POS => Payment => Invoice), how will the unique ID influence all this?

The reason I ask because we are at the beginning of setting up our system so this 1000 product list will change to regularly add more articles from Excel. So our next import might be 1500 but then it's possible the unique ID from the item that was sold through the POS before will be overwritten with another item taking over that unique ID (because items were not added at the bottom of our product list but they were sorted alphabetically so lines are added in between).

Conclusion, should we be careful with the internal IDs created in Odoo or can they just be overwritten with other products regardless if they are already sold or not?? What's the influence further down the line?...

Hopefully I could explain myself properly, if not please ask me for more info...


Thanks in advance

0
頭像
捨棄
頭像
La Jayuhni Yarsyah
最佳答案

You say that "Odoo assigns a unique ID to every single product",, its definitely wrong
Beacause when importing data,, odoo will not creating external id ,, but it's created right before you exporting the record.

https://www.odoo.com/forum/help-1/question/what-is-an-external-id-and-what-is-its-uses-95070

if i'm right,, you import data from excel file without "id" columns ,, right ??

if you not defined "id" values in csv/excel file wich you import,, then odoo would not register external id record

But why when you exporting the data odoo will show "id" column with values wich formated __export__.product_template_{number} ?it because when you export the record, odoo will check is record already has external_id ? if it not,, odoo will create external id for the record first,,

External id stored in ir.model.data,, on the backend ui,  you can access it by activating developer mode,, then go to "Settings"->technical->Sequence&Identifiers->External Identifier"

For explanation maybe you can try this step:

  1. Import an example data (without "id" column) for product.template, for example try this

    one (product.template.csv) :

    name,default_code,sale_ok,purchase_ok,list_price
    TEST PRODUCT,TEST001,1,1,25000
  2. Get your new database id data and search it on "external identifier" menu ( ir.model.data),,  find by model and record id,, see are its created after importing #1 ?

  3. Try export the data that you import,, the file will contains external id (generated by odoo)

  4. Search it on External Identifier menu,,  it should new external id generated because you imported non defined external id records

But if you try to import data with defining "id" column,, it will generate ir.model.data record when importing the record from external sources (csv/excel)

Ex (defining id in file to import):

id,name,default_code,sale_ok,purchase_ok,list_price
product_template_test001,TEST PRODUCT 1,TEST001,1,1,26000



Should be carefull ?yes,, worry will overwrite data,, but if you has a good plan for structure it very usefull

For using external sources data,, i suggest you to define the external id on spreadsheet input file to be write in odoo, because your your record stored on odoo depends by your spreadsheet/excel input,, so you need to have a same identifier between both of dabatabses (spreadsheet and pgsql/odoo) 


 

Regards..

1
頭像
捨棄
J C
作者

Great info, thanks for your reply! I understand the uses of external ids better now. If the records exist they will be updated and if they don't it will be inserted and automatically assigned an ID. That's good because in any case, the new info will be there. However we use Odoo always from importing Excel to Odoo so exporting these IDs is not needed in our case (one way).

I think the only question remaining is whether updating the product info from an Excel has influence through the POS or finance system. I don't understand how Odoo processes that in relation to the products list. I'll try to explain again with my example of the fruit before.

If I make a sale in the POS/Sales of my cherries which has ID 2. If I then update my list (import newest version) and now blueberry has ID 2 will the POS/Sale orders get messed up with that new data?

And what about if I disregard the ID and import without, will the sale process be influenced?

La Jayuhni Yarsyah

What is you mean with "ID" ??database id or external id ??

if you mean is database id,, is id on pgsql or the spreadsheet ?? i

Maybe you can show more detail data/structure that you implement,,,

If the record in odoo has "external_id", then you try to update it with importing by spreadsheet/csv file wich in those file you define an external id (id) value, it will overwrite the record (in your question that cherry will update to blueberry)

will messed up ?i think it depends on your purpose and your sale report to be expected..

if you disregard the id it will create new record.

and 1more, dont forget to checklist my answer (:-D)

Thanks and Regards

La Jayuhni Yarsyah

J C
作者

I mean database ID. The ID Odoo creates to have a unique value for every product. Let's focus on what I mean with the sale process.

I'll explain our situation better. We have a system selling spare parts and we are importing all items into Odoo part by part as we count them. So today it is a list of 500 items, next week maybe 1000 items. The list always grows. We keep everything correct in Excel first before importing into Odoo. Soon we want to start importing our first part into Odoo for a small scale test. So we are importing about 200 items with the correct name, quantity, price and barcode. Printing the barcodes and sticking them onto the items allows us to use the POS system in Odoo for registering orders. So the item gets scanned first and then registered in the POS before it is sold.

This means once a sale is done there is a POS order linked to that article, right. Hence my question how all these orders are linked to the products?

If a certain product is linked to a sale and later by importing a new list this certain item gets a new internal ID (overwritten) will we still be able to see the initial item linked to the POS order?

La Jayuhni Yarsyah

Yes it should still linked to overwritted product..

So for example:

Product (import spreadsheet):

ID = product_1, Name="Monitor", Barcode="P.001", SalePrice=200

Then the imported product will got database id=1

Then when you do transaction with odoo POS module (Sale Order Line example data):

Customer ID=100,Product ID=1,UnitPrice=200,Qty=2,Total=400

And Then, a few weeks latter you update / change product description with importing spreadsheet file , ex:

ID = product_1, Name="LED Monitor", Barcode="P.001A", SalePrice=200

When after updating the product, the current related product from sale_order_line table will still related to product_id=1,, but when you open in odoo interface, in product fields will show the current product description,,

Hope it done your questions

Regards

La Jayuhni Yarsyah

頭像
Xavier Brochard
最佳答案

Internal ID are numbers set automaticaly by Postgresql (the database engine), they will not be reused : Postgresql will allways increase the number.

As Erwin said, don't touch database (internal) IDs. But don't worry, you can't modify them without good Postgresql knowledge. I've forced internal IDs for specific needs, and after it was (hardly) done I've found a better, simpler and quicker solution.
0
頭像
捨棄
頭像
Ermin Trevisan
最佳答案

Never touch database (internal) IDs. Only use external IDs. You can export your products to see what happens to the IDs. Both IDs are IDs, they identify objects and are not influenced by processes.

0
頭像
捨棄
J C
作者

Hi Ermin, thanks for your quick answer and clarification. Do you see where my worry is? What if something is sold having a specific internal ID and then after I import a new list with more products added and the IDs change? Will Odoo have troubles mapping IDs to the new items when values are overwritten and are you sure it does not influence the sale orders and accounting stuff already created on the first ID value?

Ermin Trevisan

If you buy and sell apples, you define a product "Apple". This product has a database ID and an external ID. The IDs remain the same regardless if you buy or sell apples. You do not have an ID for single individual apples. If you import data with an external ID and this ID already exists, the existing data gets updated, if it does not exist, a new object (product) will be created.

Ermin Trevisan

If you buy and sell apples, you define a product "Apple". This product has a database ID and an external ID. The IDs remain the same regardless if you buy or sell apples. You do not have an ID for single individual apples. If you import data with an external ID and this ID already exists, the existing data gets updated, if it does not exist, a new object (product) will be created.

Ermin Trevisan

If you want to use identifications for each singular apple individually, you have to use serial numbers.

J C
作者

I'll take your example: if I have import a list of 3 articles; apples, cherries and oranges (alphabetically sorted) respectively having internal ID 1, 2 and 3 (automatically given by Odoo). If I import a new list later that adds item blueberry in between apples and cherries will the IDs shift like 1-apples 2-blueberry 3-cherries 4-oranges or will it keep the order of before and give blueberry number 4?

Are the internal IDs coupled to the the other fields or how does Odoo process this exactly?

喜歡這則討論?不要只閱讀,加入發表意見吧!

今天就建立帳戶,享受獨家功能,與我們精彩的社群互動!

註冊
社群
  • 教學影片
  • 使用說明
  • 討論區
開源
  • 下載
  • GitHub
  • Runbot 測試環境
  • 翻譯
服務
  • odoo.sh 網頁寄存
  • 支援
  • 升級
  • 自訂功能開發
  • 教育及培訓
  • 尋找會計服務
  • 尋找合作夥伴
  • 成為合作夥伴
關於我們
  • 關於 Odoo 公司
  • 品牌資產
  • 聯絡我們
  • 招聘
  • 活動
  • Podcast
  • 網誌
  • 客戶
  • 法律 • 私隱政策
  • 安全性
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo 是一套開放源碼的商業管理系統,涵蓋你公司全部的營運需要,包括客戶關係管理(CRM)、電子商務、會計、庫存管理、POS(銷售點管理)、專案管理等應用程式。

Odoo 的獨特價值是非常簡單易用,同時將不同應用程式完美整合。

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now