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

a very basic question, how i can get all customers and vendors in pgAdmin Query Tool writing a query, something like e.g. :

select * from res_partner where ???

regards


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

Hi 

Try this Query  

For customers 

select * from res_partner where customer_rank > 0

For Vendors

select * from res_partner where supplier_rank > 0


Regards

Ảnh đại diện
Huỷ bỏ
Tác giả

yes, it works fine.

thank you for help.

Tác giả Câu trả lời hay nhất

@Cybrosys

as i can't post screenshot in Comment I have to use Answer option, please check it and advice.

in my Odoo 16, there is no 'customer' or 'supplier' field in res_partner as you have mentioned. i run query just copy paste yours'.

regards


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

Hi,
Here's an example query using the pgAdmin Query Tool to retrieve all customers and vendors:

SELECT id, name, email, phone, customer, supplier
FROM res_partner
WHERE customer = TRUE OR supplier = TRUE;

Explanation of the query:

  • id: Unique identifier of the partner.
  • name: Name of the partner.
  • email: Email address of the partner.
  • phone: Phone number of the partner.
  • customer: Boolean field indicating if the partner is a customer.
  • supplier: Boolean field indicating if the partner is a vendor.

This query selects the relevant fields from the res_partner table where either the customer or supplier field is set to TRUE, indicating that the partner is either a customer or a vendor.

Hope it helps.

Ảnh đại diện
Huỷ bỏ
Tác giả

this didn't worked for me, please check screenshot in my Answer ( which is not an Answer just use it to paste screenshot ).
regards

Bài viết liên quan Trả lời Lượt xem Hoạt động
3
thg 11 23
2097
2
thg 8 25
2632
1
thg 7 25
1020
1
thg 8 25
1151
0
thg 5 25
1479