Skip to content

Commit

Permalink
[MERGE] website_(hr_recruitment): merge website_hr_recruitment to hr_…
Browse files Browse the repository at this point in the history
…recruitment

This commit merges website_hr_recruitment to hr_recruitment. by merging
`website_hr_recruitment` to hr_recruitment whenever user install `hr_recruitment`
user will also be able to access website too.

task-3880378
  • Loading branch information
arpr-odoo committed May 31, 2024
1 parent 1fa4085 commit bee78f7
Show file tree
Hide file tree
Showing 124 changed files with 1,309 additions and 48,675 deletions.
1 change: 1 addition & 0 deletions addons/hr_recruitment/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@

from . import models
from . import wizard
from . import controllers
22 changes: 21 additions & 1 deletion addons/hr_recruitment/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,19 @@
'attachment_indexation',
'web_tour',
'digest',
'website_mail',
],
'data': [
'security/hr_recruitment_security.xml',
'security/ir.model.access.csv',
'security/website_hr_recruitment_security.xml',
'data/digest_data.xml',
'data/mail_message_subtype_data.xml',
'data/mail_template_data.xml',
'data/mail_templates.xml',
'data/hr_recruitment_data.xml',
'data/config_data.xml',
'views/website_hr_recruitment_templates.xml',
'views/hr_recruitment_degree_views.xml',
'views/hr_recruitment_source_views.xml',
'views/hr_recruitment_stage_views.xml',
Expand All @@ -37,21 +41,37 @@
'views/mail_activity_views.xml',
'views/mail_activity_plan_views.xml',
'views/digest_views.xml',
'views/snippets.xml',
'wizard/applicant_refuse_reason_views.xml',
'wizard/applicant_send_mail_views.xml',
],
'demo': [
'data/hr_recruitment_demo.xml',
'data/hr_job_demo.xml',
],
'installable': True,
'application': True,
'assets': {
'web.assets_backend': [
'hr_recruitment/static/src/**/*.js',
'hr_recruitment/static/src/applicant_char/**/*.js',
'hr_recruitment/static/src/views/**/*.js',
'hr_recruitment/static/src/**/*.scss',
'hr_recruitment/static/src/**/*.xml',
'hr_recruitment/static/src/js/tours/hr_recruitment.js',
],
'web.assets_frontend': [
'hr_recruitment/static/src/scss/hr_recruitment.scss',
'hr_recruitment/static/src/js/hr_applicant_form.js',
],
'website.assets_wysiwyg': [
'hr_recruitment/static/src/js/hr_recruitment_editor.js',
],
'website.assets_editor': [
'hr_recruitment/static/src/js/systray_items/new_content.js',
],
'web.assets_tests': [
'hr_recruitment/static/tests/**/*',
],
},
'license': 'LGPL-3',
}
File renamed without changes.
25 changes: 13 additions & 12 deletions ...ebsite_hr_recruitment/controllers/main.py → addons/hr_recruitment/controllers/main.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env python3
# Part of Odoo. See LICENSE file for full copyright and licensing details.

import warnings
Expand Down Expand Up @@ -95,8 +96,8 @@ def sort(records_list, field_name):
else:
cross_country_total = total
cross_country_jobs = jobs
country_offices = set(j.address_id or None for j in cross_country_jobs)
countries = sort(set(o and o.country_id or None for o in country_offices), 'name')
country_offices = {j.address_id or None for j in cross_country_jobs}
countries = sort({o and o.country_id or None for o in country_offices}, 'name')
count_per_country = {'all': cross_country_total}
for c, jobs_list in groupby(cross_country_jobs, lambda job: job.address_id.country_id):
count_per_country[c] = len(jobs_list)
Expand All @@ -119,7 +120,7 @@ def sort(records_list, field_name):
else:
cross_department_total = total
cross_department_jobs = jobs
departments = sort(set(j.department_id or None for j in cross_department_jobs), 'name')
departments = sort({j.department_id or None for j in cross_department_jobs}, 'name')
count_per_department = {'all': cross_department_total}
for d, jobs_list in groupby(cross_department_jobs, lambda job: job.department_id):
count_per_department[d] = len(jobs_list)
Expand All @@ -143,7 +144,7 @@ def sort(records_list, field_name):
else:
cross_office_total = total
cross_office_jobs = jobs
offices = sort(set(j.address_id or None for j in cross_office_jobs), 'city')
offices = sort({j.address_id or None for j in cross_office_jobs}, 'city')
count_per_office = {'all': cross_office_total}
for o, jobs_list in groupby(cross_office_jobs, lambda job: job.address_id):
count_per_office[o] = len(jobs_list)
Expand All @@ -166,7 +167,7 @@ def sort(records_list, field_name):
else:
cross_type_total = total
cross_type_jobs = jobs
employment_types = sort(set(j.contract_type_id for j in jobs if j.contract_type_id), 'name')
employment_types = sort({j.contract_type_id for j in jobs if j.contract_type_id}, 'name')
count_per_employment_type = {'all': cross_type_total}
for t, jobs_list in groupby(cross_type_jobs, lambda job: job.contract_type_id):
count_per_employment_type[t] = len(jobs_list)
Expand All @@ -188,7 +189,7 @@ def sort(records_list, field_name):
contract_type = env['hr.contract.type'].browse(int(contract_type_id)) if contract_type_id else None

# Render page
return request.render("website_hr_recruitment.index", {
return request.render("hr_recruitment.index", {
'jobs': jobs,
'countries': countries,
'departments': departments,
Expand Down Expand Up @@ -226,7 +227,7 @@ def jobs_detail(self, job, **kwargs):

@http.route('''/jobs/<model("hr.job"):job>''', type='http', auth="public", website=True, sitemap=True)
def job(self, job, **kwargs):
return request.render("website_hr_recruitment.detail", {
return request.render("hr_recruitment.detail", {
'job': job,
'main_object': job,
})
Expand All @@ -235,10 +236,10 @@ def job(self, job, **kwargs):
def jobs_apply(self, job, **kwargs):
error = {}
default = {}
if 'website_hr_recruitment_error' in request.session:
error = request.session.pop('website_hr_recruitment_error')
default = request.session.pop('website_hr_recruitment_default')
return request.render("website_hr_recruitment.apply", {
if 'hr_recruitment_error' in request.session:
error = request.session.pop('hr_recruitment_error')
default = request.session.pop('hr_recruitment_default')
return request.render("hr_recruitment.apply", {
'job': job,
'error': error,
'default': default,
Expand Down Expand Up @@ -316,7 +317,7 @@ def _get_refused_application_response(self, job_id):
'message': message
}

@http.route('/website_hr_recruitment/check_recent_application', type='json', auth="public", website=True)
@http.route('/hr_recruitment/check_recent_application', type='json', auth="public", website=True)
def check_recent_application(self, field, value, job_id):
Applicant = http.request.env['hr.applicant'].sudo()
search_domain = self._build_search_domain(field, value)
Expand Down
File renamed without changes.
Loading

0 comments on commit bee78f7

Please sign in to comment.