Skip to content

Instantly share code, notes, and snippets.

@sharoonthomas
Created November 21, 2014 11:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sharoonthomas/6ee9436a55d1145a7bfd to your computer and use it in GitHub Desktop.
Save sharoonthomas/6ee9436a55d1145a7bfd to your computer and use it in GitHub Desktop.
Example of using angular tryton to fetch parties and addresses
'use strict';
angular.module('trytonCrmApp')
.factory('party', [
'session',
function (session) {
var getAll = function (domain, offset, limit) {
return session.rpc('model.party.party.search_read', [
domain || [], offset || null, limit || 20
]);
};
var getAddresses = function (ids) {
return session.rpc('model.party.address.read', [ids]);
};
return {
getAll: getAll,
getAddresses: getAddresses
};
}
]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment