Created
November 21, 2014 11:25
-
-
Save sharoonthomas/6ee9436a55d1145a7bfd to your computer and use it in GitHub Desktop.
Example of using angular tryton to fetch parties and addresses
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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