跳至內容
選單
此問題已被標幟
3 回覆
41196 瀏覽次數

I want to remove _sql_constraints (database level).

For example in account_invoice.py there is a constraints on number field. Now I want to remove it.

Can anyone have idea how to deal with this?

Thank you.

頭像
捨棄
最佳答案

you could remove it using psql command. for example if you have the following constraint

_sql_constraints = [
('phone_company_unique', 'unique(type,phone)', 'The phone unique among companies!')
]

you could use:

ALTER TABLE res_partner DROP CONSTRAINT res_company_phone_company_unique;

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
2
3月 15
10191
0
12月 24
9423
3
9月 24
21533
5
12月 24
52824
4
7月 24
10497