i want to check res_partner.employee_ids or res_users.employee_ids column data, can i create a SQL stataement and check the data in a database client like pgAdmin? if yes, please help to write Query or any other method to achieve it?
regards
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
i want to check res_partner.employee_ids or res_users.employee_ids column data, can i create a SQL stataement and check the data in a database client like pgAdmin? if yes, please help to write Query or any other method to achieve it?
regards
Both res_partner.employee_ids and res_user.employee_ids are One2many fields of hr.employee, then you can directly query the hr_employee table to retrieve the related records. Here's how you can construct the SQL query:
Sql
SELECT
id,
name
FROM
hr_employee;
This query will select all records from the hr_employee table, which are related to either res_partner or res_user through the employee_ids One2many field.
If you need additional information from the res_partner or res_user tables, you can perform a JOIN operation:
For res_partner.employee_ids:
Sql
SELECT
emp.id AS employee_id,
emp.name AS employee_name,
rp.id AS partner_id,
rp.name AS partner_name
FROM
hr_employee AS emp
JOIN
res_partner AS rp ON emp.partner_id = rp.id;
For res_user.employee_ids:
Sql
SELECT
emp.id AS employee_id,
emp.name AS employee_name,
ru.id AS user_id,
ru.login AS user_login
FROM
hr_employee AS emp
JOIN
res_users AS ru ON emp.user_id = ru.id;
Adjust the JOIN conditions (emp.partner_id = rp.id or emp.user_id = ru.id) according to your actual database schema.
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng kýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
|
3
thg 11 23
|
2047 | ||
|
0
thg 9 23
|
6267 | ||
|
0
thg 3 23
|
1815 | ||
Insert query in odoo 13
Đã xử lý
|
|
1
thg 7 20
|
5030 | |
|
3
thg 1 20
|
12724 |