我正在使用此library连接到odoo-sh,我能够连接到客户端对象中,并使用sessionId获得正确的用户,但是当我尝试创建新记录时,收到 Odoo会话已过期的错误,我想知道是否丢失了一些我没有发送的参数
这是代码:
const odoo = new Odoo({
host: 'company-project-xxx.dev.odoo.com',
port: 443,
protocol: 'https'
});
const client = await odoo.connect({
database: 'company-project-xxx',
username: 'user',
password: 'pass'
});
if (client) {
try {
const response = await client.create('hr.employee', [{
work_email: 'api@test.com',
name: 'api employee',
job_title: 'Robot job title',
mobile_phone: '123456',
active: true
}]);
console.log(response);
} catch (error) {
console.log(error);
}
}
任何帮助将不胜感激