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.
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
|
3
नव॰ 23
|
1978 | ||
|
0
सित॰ 23
|
6206 | ||
|
0
मार्च 23
|
1728 | ||
Insert query in odoo 13
Solved
|
|
1
जुल॰ 20
|
4956 | |
|
3
जन॰ 20
|
12654 |