Hello, I have been trying to obtain an odoo registry for months, but I have not been able to find the solution because of the little documentation that exists.
I am using json rpc in javascript, this is the query I am trying to make but it returns an empty record:
const requestAbsenceEmployeeByIdsBody =
{ jsonrpc: "2.0",
method: "call",
params: { service: "object",
method: "execute",
args: [
ODOO_DB,
uid,
ODOO_PASSWORD,
"hr.leave.type",
"get_days_all_request",
],
kwargs: [
{ context: {
lang: "es_CL",
tz: "America/Santiago",
uid: 2,
allowed_company_ids: [3],
params: {
id: 195,
cids: 3,
menu_id: 555,
action: 752,
model: "hr.employee",
view_type: "form",
},
chat_icon: true,
search_default_employee_id: 195,
active_model: "hr.employee",
active_id: 195,
active_ids: [195],
employee_id: [195],
default_employee_id: 195,
},
},
],
},
};
const { data } = await odooInstance.post( "/jsonrpc", requestAbsenceEmployeeByIdsBody );
console.log(data)
but this is the answer that comes back to me: { jsonrpc: '2.0', id: null, result: [] }
checking the payload it sends in my browser console, it does the following:
{
"id": 32,
"jsonrpc": "2.0",
"method": "call",
"params": {
"args": [],
"model": "hr.leave.type",
"method": "get_days_all_request",
"kwargs": {
"context": {
"lang": "es_CL",
"tz": "America/Santiago",
"uid": 2,
"allowed_company_ids": [
3
],
"params": {
"id": 195,
"cids": 3,
"menu_id": 555,
"action": 752,
"model": "hr.employee",
"view_type": "form"
},
"chat_icon": true,
"search_default_employee_id": 195,
"active_model": "hr.employee",
"active_id": 195,
"active_ids": [
195
],
"employee_id": [
195
],
"default_employee_id": 195
}
}
}
}
I have tried to replicate this in my request, as I showed at the beginning, but I have not been able to find a solution, I really don't know what else to do, I would be grateful for life if someone helps me with