Odoo OpenUpgrade 會用到的 SQL 語法紀錄

You are here:
< All Topics

升級 Odoo 版本有很多地方需要用到 SQL 語法,以下是更新時的紀錄

從表 account_invoice 搜尋欄位 number 中 SCNJ 開頭得記錄

select * from account_invoice where number like 'SCNJ%'

將表 account_invoice 中欄位 number 中的 SCNJ 字元替換為 RSAJ

update account_invoice set number = replace(number,'SCNJ','RSAJ')

範例:

select * from account_invoice where number like 'SCNJ%'
355
update account_invoice set number = replace(number,'SCNJ','RSAJ') 
select * from account_invoice where number like 'RSAJ%'
355
select * from account_invoice where internal_number like 'SCNJ%'
259
update account_invoice set internal_number = replace(internal_number,'SCNJ','RSAJ') 
select * from account_invoice where internal_number like 'RSAJ%'
259
select * from account_invoice where move_name like 'SCNJ%'
221
update account_invoice set move_name = replace(move_name,'SCNJ','RSAJ') 
select * from account_invoice where move_name like 'RSAJ%'
221
select * from account_invoice where number like 'ECNJ%'
34
update account_invoice set number = replace(number,'ECNJ','REXJ') 
select * from account_invoice where number like 'REXJ%'
34
select * from account_invoice where internal_number like 'ECNJ%'
28
update account_invoice set internal_number = replace(internal_number,'ECNJ','REXJ') 
select * from account_invoice where internal_number like 'REXJ%'
28
select * from account_invoice where move_name like 'ECNJ%'
35
update account_invoice set move_name = replace(move_name,'ECNJ','REXJ') 
select * from account_invoice where move_name like 'REXJ%'
35
Previous CentOS 7.0 安裝 odoo 9.0(遠端資料庫)- 轉移篇
Next Odoo:修改 Hanyu 資料庫
Table of Contents