diff options
| author | niv-openerp <nicolas.vanhoren@openerp.com> | 2012-08-06 17:03:04 +0200 |
|---|---|---|
| committer | niv-openerp <nicolas.vanhoren@openerp.com> | 2012-08-06 17:03:04 +0200 |
| commit | 8978f47ebbb5e1263529c803c8d8ba7909df2da9 (patch) | |
| tree | c49dc5307f52c9f6e1924e1c499c6c0e57254ff2 /addons/web_linkedin/static/src | |
| parent | 98ab0c6ebb0856a4a5d246304c4b9673743fce2c (diff) | |
Mapped some fields for companies
bzr revid: nicolas.vanhoren@openerp.com-20120806150304-b4s4vouwzzpokeah
Diffstat (limited to 'addons/web_linkedin/static/src')
| -rw-r--r-- | addons/web_linkedin/static/src/js/linkedin.js | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/addons/web_linkedin/static/src/js/linkedin.js b/addons/web_linkedin/static/src/js/linkedin.js index 4743c7654d3..2145bbd6dd5 100644 --- a/addons/web_linkedin/static/src/js/linkedin.js +++ b/addons/web_linkedin/static/src/js/linkedin.js @@ -88,25 +88,30 @@ openerp.web_linkedin = function(instance) { if (entity.__type === "company") { to_change.is_company = true; to_change.name = entity.name; + to_change.photo = false; if (entity.logoUrl) { defs.push(self.rpc('/web_linkedin/binary/url2binary', {'url': entity.logoUrl}).pipe(function(data){ to_change.photo = data; })); } + to_change.website = entity.websiteUrl; + to_change.phone = false; + _.each(entity.locations.values || [], function(el) { + to_change.phone = el.contactInfo.phone1; + }); /* TODO to_change.linkedinUrl = _.str.sprintf("http://www.linkedin.com/company/%d", entity.id); */ } else { // people to_change.is_company = false; to_change.name = entity.formattedName; + to_change.photo = false; if (entity.pictureUrl) { defs.push(self.rpc('/web_linkedin/binary/url2binary', {'url': entity.pictureUrl}).pipe(function(data){ to_change.photo = data; })); - } else { - to_change.photo = false; } to_change.mobile = false; to_change.phone = false; @@ -150,7 +155,8 @@ openerp.web_linkedin = function(instance) { cdef = $.Deferred(); pdef = $.Deferred(); IN.API.Raw(_.str.sprintf( - "company-search:(companies:(id,name,logo-url))?keywords=%s&count=%d", + "company-search:(companies:" + + "(id,name,logo-url,description,industry,website-url,locations))?keywords=%s&count=%d", encodeURI(this.text), this.limit)).result(function (result) { cdef.resolve(result); }); |
