Jquery Odoo 10.0前端查询数据库以存储数据
在Odoo 11.0中,我使用此方法存储数据或查询数据库:Jquery Odoo 10.0前端查询数据库以存储数据,jquery,rpc,odoo-10,Jquery,Rpc,Odoo 10,在Odoo 11.0中,我使用此方法存储数据或查询数据库: rpc.query({ model: "sale.order.checklist.line", method: "write", args: [checklist_line_id_int, { answer_yes: value }], }).then(setTimeout(function() { //Set a delay or the update is not visibl
rpc.query({
model: "sale.order.checklist.line",
method: "write",
args: [checklist_line_id_int, {
answer_yes: value
}],
}).then(setTimeout(function() {
//Set a delay or the update is not visible
window.location.reload(true);
}, 300));
我怎样才能在奥多10.0中实现同样的效果?
我需要更新用户更改的值,并使用ajax更新包含解决方案数据的单个div
//call method that write the new value for checkbox
var Checklists = new Model('sale.order.checklist.line');
Checklists.call('write', [checklist_line_id_int, {answer_yes: checkboxValue}]
).then(function () {
window.location.reload();
});
这段代码编写布尔值。
无论如何,可以在模型内调用方法,而不是编写“write”,只需调用模型内声明的方法的名称,并作为键{}传递所需的参数,以防需要传递它们