diff options
| author | Christophe Matthieu <chm@openerp.com> | 2013-11-12 11:45:09 +0100 |
|---|---|---|
| committer | Christophe Matthieu <chm@openerp.com> | 2013-11-12 11:45:09 +0100 |
| commit | 3275dcf32a1e7b08f5f30959e82af32e04bcc8b9 (patch) | |
| tree | 67f76b5c7905e398786f3b1d611bab0fa6e1ec71 /addons/website_hr_recruitment/models | |
| parent | 5b0e0a343b3a1f94f2b4d4a6d2a8cbf1de4bd774 (diff) | |
[FIX] website.hr.recruitment, website res.company: access right, add a constraint with address_id (must be published) on hr.recruitment and add a related field website_published on res.company
bzr revid: chm@openerp.com-20131112104509-0n266eias5oc55gb
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 96e2c1d7efd..8c341467354 100644 --- a/addons/website_hr_recruitment/models/hr_job.py +++ b/addons/website_hr_recruitment/models/hr_job.py @@ -10,3 +10,12 @@ class hr_job(osv.osv): 'website_published': fields.boolean('Available in the website'), 'website_description': fields.html('Description for the website'), } + + def _check_address_id_published(self, cr, uid, ids, context=None): + for obj in self.browse(cr, uid, ids, context=context): + if obj.website_published and obj.address_id and not obj.address_id.website_published: + return False + return True + _constraints = [ + (_check_address_id_published, "This Jobpost can't be published if the field Job Location is not website published.", ['address_id','website_published']), + ]
\ No newline at end of file |
