From d27910a8f2f2b29810dfa8022ad748cce64df00a Mon Sep 17 00:00:00 2001 From: dka-odoo Date: Tue, 20 Jan 2015 13:53:07 +0100 Subject: [PATCH] [IMP] hr_department: new kanban view for HR Departments. hr add a simple kanban view that is updated by the various hr modules. Each module adds statistics and links in the kanban vignette, either in a to do or to approve column. The department kanban view can be seen as a small dashboard to have the main data about the department displayed. Links allow the HR manager to be redirected towards the various things to do or to approve in its department. --- addons/hr/__openerp__.py | 16 +- addons/hr/hr.py | 7 +- addons/hr/hr_view.xml | 101 ++++++++++-- addons/hr/res_config.py | 4 + addons/hr/res_config_view.xml | 4 + addons/hr/security/hr_security.xml | 5 + addons/hr/static/src/js/hr.js | 14 ++ addons/hr/static/src/less/hr_department.less | 11 ++ addons/hr/views/hr.xml | 2 + addons/hr_contract/hr_contract_view.xml | 4 +- addons/hr_evaluation/__init__.py | 1 + addons/hr_evaluation/hr_department.py | 29 ++++ addons/hr_evaluation/hr_evaluation_view.xml | 54 ++++++- addons/hr_expense/__init__.py | 1 + addons/hr_expense/hr_department.py | 16 ++ addons/hr_expense/hr_expense_data.xml | 2 +- addons/hr_expense/hr_expense_view.xml | 61 ++++++-- .../report/hr_expense_report_view.xml | 4 +- addons/hr_holidays/__init__.py | 1 + addons/hr_holidays/hr_department.py | 56 +++++++ addons/hr_holidays/hr_holidays.py | 42 ++++- addons/hr_holidays/hr_holidays_data.xml | 2 +- addons/hr_holidays/hr_holidays_view.xml | 147 +++++++++++++++--- addons/hr_recruitment/__init__.py | 1 + addons/hr_recruitment/hr_department.py | 33 ++++ addons/hr_recruitment/hr_recruitment.py | 37 ++++- addons/hr_recruitment/hr_recruitment_data.xml | 15 ++ addons/hr_recruitment/hr_recruitment_view.xml | 105 +++++++++++-- addons/hr_timesheet_sheet/__init__.py | 1 + addons/hr_timesheet_sheet/hr_department.py | 17 ++ .../hr_timesheet_sheet_view.xml | 48 +++++- 31 files changed, 752 insertions(+), 89 deletions(-) create mode 100644 addons/hr/static/src/js/hr.js create mode 100644 addons/hr/static/src/less/hr_department.less create mode 100644 addons/hr_evaluation/hr_department.py create mode 100644 addons/hr_expense/hr_department.py create mode 100644 addons/hr_holidays/hr_department.py create mode 100644 addons/hr_recruitment/hr_department.py create mode 100644 addons/hr_timesheet_sheet/hr_department.py diff --git a/addons/hr/__openerp__.py b/addons/hr/__openerp__.py index 3830b5fe60f..6b118d426b8 100644 --- a/addons/hr/__openerp__.py +++ b/addons/hr/__openerp__.py @@ -42,7 +42,19 @@ You can manage: """, 'author': 'OpenERP SA', 'website': 'https://www.odoo.com/page/employees', - 'depends': ['base_setup', 'mail', 'resource', 'board', 'web_tip'], + 'images': [ + 'images/hr_department.jpeg', + 'images/hr_employee.jpeg', + 'images/hr_job_position.jpeg', + 'static/src/img/default_image.png', + ], + 'depends': [ + 'base_setup', + 'mail', + 'resource', + 'board', + 'web_kanban', + ], 'data': [ 'security/hr_security.xml', 'security/ir.model.access.csv', @@ -64,5 +76,5 @@ You can manage: 'installable': True, 'application': True, 'auto_install': False, - 'qweb': [ 'static/src/xml/suggestions.xml' ], + 'qweb': ['static/src/xml/suggestions.xml'], } diff --git a/addons/hr/hr.py b/addons/hr/hr.py index 25b8939569c..8a6f828f730 100644 --- a/addons/hr/hr.py +++ b/addons/hr/hr.py @@ -391,6 +391,7 @@ class hr_department(osv.osv): 'member_ids': fields.one2many('hr.employee', 'department_id', 'Members', readonly=True), 'jobs_ids': fields.one2many('hr.job', 'department_id', 'Jobs'), 'note': fields.text('Note'), + 'color': fields.integer('Color Index'), } _defaults = { @@ -414,10 +415,12 @@ class hr_department(osv.osv): ] def name_get(self, cr, uid, ids, context=None): - if context is None: - context = {} if not ids: return [] + if isinstance(ids, (int, long)): + ids = [ids] + if context is None: + context = {} reads = self.read(cr, uid, ids, ['name','parent_id'], context=context) res = [] for record in reads: diff --git a/addons/hr/hr_view.xml b/addons/hr/hr_view.xml index fff137c964e..c2e7515fc91 100644 --- a/addons/hr/hr_view.xml +++ b/addons/hr/hr_view.xml @@ -45,14 +45,14 @@ - - + @@ -75,8 +75,8 @@ - @@ -114,7 +114,7 @@ - + @@ -129,14 +129,14 @@ - + - + @@ -181,7 +181,7 @@ - +
- + -