@@ -54,6 +54,7 @@ Odoo.prototype.connect = function (cb) {
5454 self . uid = response . result . uid ;
5555 self . sid = res . headers [ 'set-cookie' ] [ 0 ] . split ( ';' ) [ 0 ] ;
5656 self . session_id = response . result . session_id ;
57+ self . context = response . result . user_context ;
5758
5859 return cb ( null , response . result ) ;
5960 } ) ;
@@ -65,7 +66,9 @@ Odoo.prototype.connect = function (cb) {
6566// Create record
6667Odoo . prototype . create = function ( model , params , callback ) {
6768 this . _request ( '/web/dataset/call_kw' , {
68- kwargs : { } ,
69+ kwargs : {
70+ context : this . context
71+ } ,
6972 model : model ,
7073 method : 'create' ,
7174 args : [ params ]
@@ -85,7 +88,9 @@ Odoo.prototype.get = function (model, id, callback) {
8588Odoo . prototype . update = function ( model , id , params , callback ) {
8689 if ( id ) {
8790 this . _request ( '/web/dataset/call_kw' , {
88- kwargs : { } ,
91+ kwargs : {
92+ context : this . context
93+ } ,
8994 model : model ,
9095 method : 'write' ,
9196 args : [ [ id ] , params ]
@@ -96,7 +101,9 @@ Odoo.prototype.update = function (model, id, params, callback) {
96101// Delete record
97102Odoo . prototype . delete = function ( model , id , callback ) {
98103 this . _request ( '/web/dataset/call_kw' , {
99- kwargs : { } ,
104+ kwargs : {
105+ context : this . context
106+ } ,
100107 model : model ,
101108 method : 'unlink' ,
102109 args : [ [ id ] ]
@@ -106,7 +113,9 @@ Odoo.prototype.delete = function (model, id, callback) {
106113// Search records
107114Odoo . prototype . search = function ( model , params , callback ) {
108115 this . _request ( '/web/dataset/call_kw' , {
109- kwargs : { } ,
116+ kwargs : {
117+ context : this . context
118+ } ,
110119 model : model ,
111120 method : 'search' ,
112121 args : [ params ]
0 commit comments