diff --git a/addons/website_hr_recruitment/controllers/main.py b/addons/website_hr_recruitment/controllers/main.py
index c13b1638..2814fb2f 100644
--- a/addons/website_hr_recruitment/controllers/main.py
+++ b/addons/website_hr_recruitment/controllers/main.py
@@ -29,6 +29,8 @@ class WebsiteHrRecruitment(http.Controller):
# List jobs available to current UID
job_ids = Jobs.search([], order="website_published desc,no_of_recruitment desc").ids
+ if not request.env['res.users'].has_group('website.group_website_publisher'):
+ job_ids = Jobs.search(['|',('website_ids', '=', False), ('website_ids', 'in', request.website.id)], order="website_published desc, no_of_recruitment desc").ids
# Browse jobs as superuser, because address is restricted
jobs = Jobs.sudo().browse(job_ids)
diff --git a/addons/website_hr_recruitment/data/config_data.xml b/addons/website_hr_recruitment/data/config_data.xml
index d4e0d6eb..5a28e243 100644
--- a/addons/website_hr_recruitment/data/config_data.xml
+++ b/addons/website_hr_recruitment/data/config_data.xml
@@ -32,6 +32,7 @@
'partner_phone',
'job_id',
'department_id',
+ 'website_id',
]"/>
diff --git a/addons/website_hr_recruitment/models/hr_recruitment.py b/addons/website_hr_recruitment/models/hr_recruitment.py
index 8056b29d..91e16790 100644
--- a/addons/website_hr_recruitment/models/hr_recruitment.py
+++ b/addons/website_hr_recruitment/models/hr_recruitment.py
@@ -29,6 +29,7 @@ class RecruitmentSource(models.Model):
class Applicant(models.Model):
_inherit = 'hr.applicant'
+ website_id = fields.Many2one('website', string="Website")
def website_form_input_filter(self, request, values):
if 'partner_name' in values:
@@ -46,6 +47,10 @@ class Job(models.Model):
return (default_description.render() if default_description else "")
website_description = fields.Html('Website description', translate=html_translate, sanitize_attributes=False, default=_get_default_website_description)
+ website_ids = fields.Many2many('website', 'website_hr_job_pub_rel',
+ 'website_id', 'job_id',
+ string='Websites', copy=False,
+ help='List of websites in which Job is published.')
@api.multi
def _compute_website_url(self):
diff --git a/addons/website_hr_recruitment/views/hr_recruitment_views.xml b/addons/website_hr_recruitment/views/hr_recruitment_views.xml
index ec9dec58..2d8e3bf9 100644
--- a/addons/website_hr_recruitment/views/hr_recruitment_views.xml
+++ b/addons/website_hr_recruitment/views/hr_recruitment_views.xml
@@ -22,6 +22,9 @@
+
+
+
\ No newline at end of file