Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
3 Trả lời
7208 Lượt xem

Hi guys,

Stuck here for quite a few hours now. Anyone who can share what's the correct syntax to call the write method in javascript? So far, I have below code that doesnt work. Thanks !

var model = new instance.web.Model("my.product");
var values = [{'name' : "james"}];
var id = 1;
model.call('write', [[id], values]],  {context: new instance.web.CompoundContext()})
Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

James try this

model.call("write", [[id], {'name': "james"}])

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hello,

For this Please do like this :

new instance.web.Model('crm.lead').call('write', [[val]], {})
.then(function(result){
console.log("main resultttttttttttt", result); 
}));

Hope this will help you..

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

Im getting this error when i do that:


assert isinstance(record_id, (int, long))
AssertionErrorAssertionError

The my.product model has only 2 fields: id and name. Im assuming that (int, long) refers to those 2 fields. I've tried lots of combinations of (, {, [ but nothing seems to work.
Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 7 25
732
1
thg 7 25
5795
0
thg 7 25
1421
0
thg 6 25
1351
1
thg 6 25
1407