diff options
| author | Christophe Matthieu <chm@openerp.com> | 2013-12-02 13:56:02 +0100 |
|---|---|---|
| committer | Christophe Matthieu <chm@openerp.com> | 2013-12-02 13:56:02 +0100 |
| commit | de0401e043f424b17c2a5238c732486020369d2f (patch) | |
| tree | 8a5e53fac2f01c0b1bbe973b203344ed24705fdb /addons/website_hr_recruitment/models | |
| parent | c1f306dd969c16ec5ebe57833353d11fb20d3b94 (diff) | |
[IMP] website_hr_recruitment: add website_button widget in backend
bzr revid: chm@openerp.com-20131202125602-zqq9k8ivwkb7fh7c
Diffstat (limited to 'addons/website_hr_recruitment/models')
| -rw-r--r-- | addons/website_hr_recruitment/models/hr_job.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/addons/website_hr_recruitment/models/hr_job.py b/addons/website_hr_recruitment/models/hr_job.py index 3b4cb7dba60..d2624231fc7 100644 --- a/addons/website_hr_recruitment/models/hr_job.py +++ b/addons/website_hr_recruitment/models/hr_job.py @@ -6,9 +6,18 @@ from openerp.osv import osv, fields class hr_job(osv.osv): """ Override to add website-related columns: published, description. """ _inherit = "hr.job" + + def _website_url(self, cr, uid, ids, field_name, arg, context=None): + res = dict.fromkeys(ids, '') + base_url = self.pool.get('ir.config_parameter').get_param(cr, uid, 'web.base.url') + for job in self.browse(cr, uid, ids, context=context): + res[job.id] = "%s/job/detail/%s/" % (base_url, job.id) + return res + _columns = { 'website_published': fields.boolean('Available in the website'), 'website_description': fields.html('Description for the website'), + 'website_url': fields.function(_website_url, string="Website url", type="char"), } _defaults = { 'website_published': False |
