Skip to content

Commit 47d76f2

Browse files
author
saidimu apale
committed
[ADD] Added docs for the generic RPC call
1 parent 012da48 commit 47d76f2

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,40 @@ odoo.browse_by_id('product.product', params, function (err, products) {
9191
}); //browse_by_id
9292

9393

94+
// Generic RPC call
95+
// Note that, unlike the other methods, the context is not automatically included
96+
var endpoint = '/web/dataset/call_kw';
97+
var model = 'sale.order';
98+
var method = 'action_view_delivery';
99+
100+
var args = [
101+
[sale_order_id],
102+
{
103+
tz: odoo.context.tz,
104+
uid: odoo.context.uid,
105+
},
106+
];//args
107+
108+
var params = {
109+
model: model,
110+
method: method,
111+
args: args,
112+
kwargs: {},
113+
};//params
114+
115+
// View Delivery Order
116+
odoo.rpc_call(endpoint, params, function(err, result) {
117+
if(err) {
118+
console.log(err);
119+
return;
120+
}//if
121+
122+
var delivery_order = result;
123+
124+
console.log(delivery_order);
125+
});//odoo.rpc_call
126+
127+
94128
```
95129

96130
## Methods
@@ -103,6 +137,7 @@ odoo.browse_by_id('product.product', params, function (err, products) {
103137
* odoo.create(model, params, callback)
104138
* odoo.update(model, id, params, callback)
105139
* odoo.delete(model, id, callback)
140+
* odoo.rpc_call(endpoint, params, callback);
106141

107142
##Node version
108143
Works better with NodeJS v11.16 and further

0 commit comments

Comments
 (0)