2013-08-14 12:33:27 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
|
|
|
from openerp.osv import osv, fields
|
|
|
|
|
|
|
|
class hr_job(osv.osv):
|
2013-12-16 13:35:49 +00:00
|
|
|
_name = 'hr.job'
|
|
|
|
_inherit = ['hr.job','website.seo.metadata']
|
2013-12-02 12:56:02 +00:00
|
|
|
|
|
|
|
def _website_url(self, cr, uid, ids, field_name, arg, context=None):
|
|
|
|
res = dict.fromkeys(ids, '')
|
|
|
|
for job in self.browse(cr, uid, ids, context=context):
|
2014-03-14 16:23:46 +00:00
|
|
|
res[job.id] = "/jobs/detail/%s" % job.id
|
2013-12-02 12:56:02 +00:00
|
|
|
return res
|
|
|
|
|
2014-01-23 14:03:48 +00:00
|
|
|
def job_open(self, cr, uid, ids, context=None):
|
|
|
|
self.write(cr, uid, ids, {'website_published': False}, context=context)
|
|
|
|
return super(hr_job, self).job_open(cr, uid, ids, context)
|
|
|
|
|
2013-08-14 12:33:27 +00:00
|
|
|
_columns = {
|
2014-07-06 14:44:26 +00:00
|
|
|
'website_published': fields.boolean('Published', copy=False),
|
2014-01-29 05:14:03 +00:00
|
|
|
'website_description': fields.html('Website description'),
|
|
|
|
'website_url': fields.function(_website_url, string="Website URL", type="char"),
|
2013-11-16 09:53:01 +00:00
|
|
|
}
|
|
|
|
_defaults = {
|
|
|
|
'website_published': False
|
|
|
|
}
|