|
@@ -5,20 +5,18 @@ angular.module('odoo')
|
|
auth: function (config, success, error) {
|
|
auth: function (config, success, error) {
|
|
xmlrpc.callMethod(methodCallManager.call('authenticate', config), [config.database, config.username, config.password, {}]).then(function (response) {
|
|
xmlrpc.callMethod(methodCallManager.call('authenticate', config), [config.database, config.username, config.password, {}]).then(function (response) {
|
|
if (!response || response['faultCode']) {
|
|
if (!response || response['faultCode']) {
|
|
- error(response);
|
|
|
|
- return;
|
|
|
|
|
|
+ return error(response);
|
|
}
|
|
}
|
|
|
|
|
|
- success({ id: response, username: config.username, password: config.password });
|
|
|
|
|
|
+ success(response);
|
|
}, function (xmlrpcError) {
|
|
}, function (xmlrpcError) {
|
|
error(xmlrpcError);
|
|
error(xmlrpcError);
|
|
});
|
|
});
|
|
},
|
|
},
|
|
read: function (model, domain, config, success, error) {
|
|
read: function (model, domain, config, success, error) {
|
|
- xmlrpc.callMethod(methodCallManager.call('execute_kw', config), [config.database, config.remote_id, config.password, model, 'search_read', [domain]]).then(function (response) {
|
|
|
|
|
|
+ xmlrpc.callMethod(methodCallManager.call('execute_kw', config), [config.database, config.id, config.password, model, 'search_read', [domain]]).then(function (response) {
|
|
if (!response || response['faultCode']) {
|
|
if (!response || response['faultCode']) {
|
|
- error(response);
|
|
|
|
- return;
|
|
|
|
|
|
+ return error(response);
|
|
}
|
|
}
|
|
|
|
|
|
success(response);
|
|
success(response);
|
|
@@ -27,10 +25,9 @@ angular.module('odoo')
|
|
});
|
|
});
|
|
},
|
|
},
|
|
create: function (model, data, config, success, error) {
|
|
create: function (model, data, config, success, error) {
|
|
- xmlrpc.callMethod(methodCallManager.call('execute_kw', config), [config.database, config.remote_id, config.password, model, 'create', [data]]).then(function (response) {
|
|
|
|
|
|
+ xmlrpc.callMethod(methodCallManager.call('execute_kw', config), [config.database, config.id, config.password, model, 'create', [data]]).then(function (response) {
|
|
if (!response || response['faultCode']) {
|
|
if (!response || response['faultCode']) {
|
|
- error(response);
|
|
|
|
- return;
|
|
|
|
|
|
+ return error(response);
|
|
}
|
|
}
|
|
|
|
|
|
success(response);
|
|
success(response);
|
|
@@ -39,10 +36,9 @@ angular.module('odoo')
|
|
});
|
|
});
|
|
},
|
|
},
|
|
write: function (model, id, data, config, success, error) {
|
|
write: function (model, id, data, config, success, error) {
|
|
- xmlrpc.callMethod(methodCallManager.call('execute_kw', config), [config.database, config.remote_id, config.password, model, 'write', [[id], data]]).then(function (response) {
|
|
|
|
|
|
+ xmlrpc.callMethod(methodCallManager.call('execute_kw', config), [config.database, config.id, config.password, model, 'write', [[id], data]]).then(function (response) {
|
|
if (!response || response['faultCode']) {
|
|
if (!response || response['faultCode']) {
|
|
- error(response);
|
|
|
|
- return;
|
|
|
|
|
|
+ return error(response);
|
|
}
|
|
}
|
|
|
|
|
|
success(response);
|
|
success(response);
|
|
@@ -51,10 +47,9 @@ angular.module('odoo')
|
|
});
|
|
});
|
|
},
|
|
},
|
|
unlink: function (model, id, config, success, error) {
|
|
unlink: function (model, id, config, success, error) {
|
|
- xmlrpc.callMethod(methodCallManager.call('execute_kw', config), [config.database, config.remote_id, config.password, model, 'unlink', [[id]]]).then(function (response) {
|
|
|
|
|
|
+ xmlrpc.callMethod(methodCallManager.call('execute_kw', config), [config.database, config.id, config.password, model, 'unlink', [[id]]]).then(function (response) {
|
|
if (!response || response['faultCode']) {
|
|
if (!response || response['faultCode']) {
|
|
- error(response);
|
|
|
|
- return;
|
|
|
|
|
|
+ return error(response);
|
|
}
|
|
}
|
|
|
|
|
|
success(response);
|
|
success(response);
|
|
@@ -63,7 +58,7 @@ angular.module('odoo')
|
|
});
|
|
});
|
|
},
|
|
},
|
|
check: function (model, operation, success, error) {
|
|
check: function (model, operation, success, error) {
|
|
- xmlrpc.callMethod(methodCallManager.call('execute_kw', config), [config.database, config.remote_id, config.password, model, 'check_access_rights', [operation], { 'raise_exception': false }]).then(function (response) {
|
|
|
|
|
|
+ xmlrpc.callMethod(methodCallManager.call('execute_kw', config), [config.database, config.id, config.password, model, 'check_access_rights', [operation], { 'raise_exception': false }]).then(function (response) {
|
|
if (!response || response['faultCode']) {
|
|
if (!response || response['faultCode']) {
|
|
return error(response);
|
|
return error(response);
|
|
}
|
|
}
|
|
@@ -74,7 +69,7 @@ angular.module('odoo')
|
|
});
|
|
});
|
|
},
|
|
},
|
|
fields: function (model, config, success, error) {
|
|
fields: function (model, config, success, error) {
|
|
- xmlrpc.callMethod(methodCallManager.call('execute_kw', config), [config.database, config.remote_id, config.password, model, 'fields_get', [], { 'attributes': ['type', 'readonly', 'required', 'relation', 'relation_field'] }]).then(function (response) {
|
|
|
|
|
|
+ xmlrpc.callMethod(methodCallManager.call('execute_kw', config), [config.database, config.id, config.password, model, 'fields_get', [], { 'attributes': ['type', 'readonly', 'required', 'relation', 'relation_field'] }]).then(function (response) {
|
|
if (!response || response['faultCode']) {
|
|
if (!response || response['faultCode']) {
|
|
return error(response);
|
|
return error(response);
|
|
}
|
|
}
|