diff options
| author | Nicolas Lempereur <nle@odoo.com> | 2015-04-22 09:33:12 +0200 |
|---|---|---|
| committer | Nicolas Lempereur <nle@odoo.com> | 2015-04-27 12:57:35 +0200 |
| commit | 068071cf9ab707c12ae0e5ca24adae58f9a7b3ea (patch) | |
| tree | 9b310c4a32a19508ac9cc2aef96e9e197059e74b | |
| parent | 675fd554f15e6caeb462ae120c7841c7f76b3c0a (diff) | |
[FIX] website_hr: add published for hr.employee
Previously, we could unpublish an employee from the website, but there
was no simple way to publish it again after we leave the page.
This fix show the unpublished employees on the about us page for the
users who can modify these employees records.
closes #6416
opw-633462
| -rw-r--r-- | addons/website_hr/controllers/main.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/addons/website_hr/controllers/main.py b/addons/website_hr/controllers/main.py index 430c47b5dfa..6874914bf3e 100644 --- a/addons/website_hr/controllers/main.py +++ b/addons/website_hr/controllers/main.py @@ -8,8 +8,10 @@ class website_hr(http.Controller): @http.route(['/page/website.aboutus', '/page/aboutus'], type='http', auth="public", website=True) def blog(self, **post): hr_obj = request.registry['hr.employee'] - employee_ids = hr_obj.search(request.cr, request.uid, [('website_published', '=', True)], - context=request.context) + domain = [] + if not hr_obj.check_access_rights(request.cr, request.uid, 'write', raise_exception=False): + domain.append(('website_published', '=', True)) + employee_ids = hr_obj.search(request.cr, request.uid, domain, context=request.context) values = { 'employee_ids': hr_obj.browse(request.cr, request.uid, employee_ids, request.context) |
