diff options
| author | Christophe Matthieu <chm@openerp.com> | 2013-01-21 09:43:19 +0100 |
|---|---|---|
| committer | Christophe Matthieu <chm@openerp.com> | 2013-01-21 09:43:19 +0100 |
| commit | 762a3635ebbdd7d0017dee237090a82193748088 (patch) | |
| tree | d7f1b95804ecbb116e9e046fbd7a72c26ad3e07c /addons/web_linkedin/web_linkedin.py | |
| parent | 09b2527ddb1a9ee30779a382f550ac3440cdae29 (diff) | |
[IMP] linkedin
bzr revid: chm@openerp.com-20130121084319-aa0tdiz2vgbql726
Diffstat (limited to 'addons/web_linkedin/web_linkedin.py')
| -rw-r--r-- | addons/web_linkedin/web_linkedin.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/addons/web_linkedin/web_linkedin.py b/addons/web_linkedin/web_linkedin.py index 1296bb7aa28..7305ca4b016 100644 --- a/addons/web_linkedin/web_linkedin.py +++ b/addons/web_linkedin/web_linkedin.py @@ -21,6 +21,7 @@ import base64 import urllib2 +import linkedin # TODO add depensy in packaging import openerp from openerp.osv import fields, osv @@ -49,8 +50,18 @@ class web_linkedin_settings(osv.osv_memory): key = self.browse(cr, uid, ids[0], context)["api_key"] or "" self.pool.get("ir.config_parameter").set_param(cr, uid, "web.linkedin.apikey", key) -class web_linkedin_fields(osv.osv_memory): +class web_linkedin_fields(osv.Model): _inherit = 'res.partner' + + def _get_url(self, cr, uid, ids, name, arg, context=None): + res = dict((id, False) for id in ids) + for partner in self.browse(cr, uid, ids, context=context): + res[partner.id] = partner.linkedin_url + return res + _columns = { 'linkedin_id': fields.char(string="LinkedIn ID", size=50), + 'linkedin_url': fields.char(string="LinkedIn url", size=100, store=True), + 'linkedin_public_url': fields.function(_get_url, type='text', string="LinkedIn url", + help="This url is set automatically when you join the partner with a LinkedIn account."), }
\ No newline at end of file |
