Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
3 Trả lời
41232 Lượt xem

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.

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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;

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 3 15
10213
0
thg 12 24
9443
3
thg 9 24
21574
5
thg 12 24
52868
4
thg 7 24
10547