diff --git a/addons/hr/hr.py b/addons/hr/hr.py index af9b0db7afc..0419445c82d 100644 --- a/addons/hr/hr.py +++ b/addons/hr/hr.py @@ -26,10 +26,28 @@ import tools from tools.translate import _ class hr_employee_category(osv.osv): + + def name_get(self, cr, uid, ids, context=None): + if not len(ids): + return [] + reads = self.read(cr, uid, ids, ['name','parent_id'], context) + res = [] + for record in reads: + name = record['name'] + if record['parent_id']: + name = record['parent_id'][1]+' / '+name + res.append((record['id'], name)) + return res + + def _name_get_fnc(self, cr, uid, ids, prop, unknow_none, context): + res = self.name_get(cr, uid, ids, context) + return dict(res) + _name = "hr.employee.category" _description = "Employee Category" _columns = { 'name': fields.char("Category", size=64, required=True), + 'complete_name': fields.function(_name_get_fnc, method=True, type="char", string='Name'), 'parent_id': fields.many2one('hr.employee.category', 'Parent Category', select=True), 'child_ids': fields.one2many('hr.employee.category', 'parent_id', 'Child Categories') } @@ -117,7 +135,7 @@ class hr_employee(osv.osv): 'address_id': fields.many2one('res.partner.address', 'Working Address'), 'address_home_id': fields.many2one('res.partner.address', 'Home Address'), 'partner_id': fields.related('address_home_id', 'partner_id', type='many2one', relation='res.partner', readonly=True, help="Partner that is related to the current employee. Accounting transaction will be written on this partner belongs to employee."), - 'work_phone': fields.related('address_id', 'phone', type='char', string='Work Phone', readonly=True), + 'work_phone': fields.related('address_id', 'phone', type='char', size=32, string='Work Phone', readonly=True), 'work_email': fields.related('address_id', 'email', type='char', size=240, string='Work E-mail'), 'work_location': fields.char('Office Location', size=32), 'notes': fields.text('Notes'), @@ -135,21 +153,25 @@ class hr_employee(osv.osv): company_id = self.pool.get('res.company').browse(cr,uid,company) for address in company_id.partner_id.address: return {'value': {'address_id': address.id}} - return {'value':{}} + return {'value':{'address_id':False}} def onchange_department(self, cr, uid, ids, department_id, context=None): - manager = self.pool.get('hr.department').browse(cr, uid, department_id).manager_id.id - return {'value': {'parent_id':manager or False}} + if not department_id: + return {'value':{'parent_id': False}} + manager = self.pool.get('hr.department').browse(cr, uid, department_id).manager_id + return {'value': {'parent_id':manager and manager.id or False}} def onchange_user(self, cr, uid, ids, user_id, context=None): + if not user_id: + return {'value':{'work_email': False}} mail = self.pool.get('res.users').browse(cr,uid,user_id) - return {'value': {'work_email':mail.user_email}} - + return {'value': {'work_email':mail.user_email}} + def _get_photo(self, cr, uid, context=None): return open(os.path.join( tools.config['addons_path'], 'hr/image', 'photo.png'), 'rb') .read().encode('base64') - + _defaults = { 'active': 1, 'photo': _get_photo, diff --git a/addons/hr/hr_department_view.xml b/addons/hr/hr_department_view.xml index c80c0cd91d4..b64f7ca0413 100644 --- a/addons/hr/hr_department_view.xml +++ b/addons/hr/hr_department_view.xml @@ -67,7 +67,7 @@ Your Company's Departments Structure is used to manage all documents related to employees by departments: expenses and timesheet validation, leaves management, recruitements, etc. - + res.users.form diff --git a/addons/hr/hr_view.xml b/addons/hr/hr_view.xml index fc327c6580d..e171f2dfba7 100644 --- a/addons/hr/hr_view.xml +++ b/addons/hr/hr_view.xml @@ -3,10 +3,10 @@ - - + + - + @@ -224,11 +225,12 @@ - Contract + Contracts hr.contract form tree,form [] + {'search_default_current':1} @@ -276,7 +278,7 @@ - + - - Human Resources / Contract - - diff --git a/addons/hr_contract/security/ir.model.access.csv b/addons/hr_contract/security/ir.model.access.csv index 9ed14b14755..36456284856 100644 --- a/addons/hr_contract/security/ir.model.access.csv +++ b/addons/hr_contract/security/ir.model.access.csv @@ -1,20 +1,7 @@ "id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" -"access_hr_contract_wage_type_period_manager","hr.contract.wage.type.period.manager","model_hr_contract_wage_type_period","base.group_hr_manager",1,1,1,1 -"access_hr_contract_wage_type_manager","hr.contract.wage.type.manager","model_hr_contract_wage_type","base.group_hr_manager",1,1,1,1 -"access_hr_contract_wage_type_contract","hr.contract.wage.type.contract","model_hr_contract_wage_type","base.group_hr_contract",1,1,1,1 -"access_hr_contract_wage_type_period_contract","hr.contract.wage.type.period.contract","model_hr_contract_wage_type_period","base.group_hr_contract",1,1,1,1 -"access_hr_contract_contract","hr.contract.contract","model_hr_contract","base.group_hr_contract",1,1,1,1 -"access_hr_employee_contract_contract","hr.employee.contract.contract","hr.model_hr_employee","base.group_hr_contract",1,1,1,1 -"access_hr_resource_contract","hr.employee.resource.contract","resource.model_resource_resource","base.group_hr_contract",1,1,1,1 -"access_hr_resource_calendar_contract","hr.employee.resource.calendar.contract","resource.model_resource_calendar","base.group_hr_contract",1,1,1,1 -"access_hr_job_contract","hr.job contract","hr.model_hr_job","base.group_hr_contract",1,1,1,1 -"access_hr_contract_type_contract","hr.contract.type.contract","model_hr_contract_type","base.group_hr_contract",1,1,1,1 -"access_hr_contract_wage_type_system","hr.contract.wage.type.system","model_hr_contract_wage_type","base.group_system",1,1,1,1 -"access_hr_contract_wage_type_period_system","hr.contract.wage.type.period.system","model_hr_contract_wage_type_period","base.group_system",1,1,1,1 -"access_hr_contract_type_system","hr.contract.type.system","model_hr_contract_type","base.group_system",1,1,1,1 -"access_hr_contract_system","hr.contract.system","model_hr_contract","base.group_system",1,1,1,1 -"access_hr_employee_category_contract","hr.employee.category.contract","hr.model_hr_employee_category","base.group_hr_contract",1,1,1,1 -"access_hr_department_contract","hr.department.contract","hr.model_hr_department","base.group_hr_contract",1,1,1,1 -"access_hr_contract_manager","hr.contract.manager","model_hr_contract","base.group_hr_manager",1,1,1,1 -"access_hr_contract_employee","hr.contract.employee","model_hr_contract","base.group_user",1,0,0,0 +"access_hr_contract_wage_type_period_user","hr.contract.wage.type.period.user","model_hr_contract_wage_type_period","base.group_hr_user",1,1,1,1 +"access_hr_contract_wage_type_user","hr.contract.wage.type.user","model_hr_contract_wage_type","base.group_hr_user",1,1,1,1 +"access_hr_contract_user","hr.contract.user","model_hr_contract","base.group_hr_user",1,1,1,1 +"access_hr_resource_manager","hr.employee.resource.manager","resource.model_resource_resource","base.group_hr_manager",1,1,1,1 +"access_hr_resource_calendar_user","hr.employee.resource.calendar.user","resource.model_resource_calendar","base.group_hr_user",1,1,1,1 "access_hr_contract_type_manager","hr.contract.type.manager","model_hr_contract_type","base.group_hr_manager",1,1,1,1 diff --git a/addons/hr_evaluation/hr_evaluation.py b/addons/hr_evaluation/hr_evaluation.py index 263b34322b9..960849bdfd4 100644 --- a/addons/hr_evaluation/hr_evaluation.py +++ b/addons/hr_evaluation/hr_evaluation.py @@ -33,7 +33,7 @@ class hr_evaluation_plan(osv.osv): 'name': fields.char("Evaluation Plan", size=64, required=True), 'company_id': fields.many2one('res.company', 'Company', required=True), 'phase_ids': fields.one2many('hr_evaluation.plan.phase', 'plan_id', 'Evaluation Phases'), - 'month_first': fields.integer('First Evaluation After'), + 'month_first': fields.integer('Next Evaluation After'), 'month_next': fields.integer('After the Date of Start'), 'active': fields.boolean('Active') } @@ -115,12 +115,11 @@ class hr_employee(osv.osv): return True def onchange_evaluation_plan_id(self, cr, uid, ids, evaluation_plan_id, evaluation_date, context=None): - evaluation_date = evaluation_date or False - evaluation_plan_obj=self.pool.get('hr_evaluation.plan') - obj_evaluation = self.pool.get('hr_evaluation.evaluation') if context is None: context = {} if evaluation_plan_id: + evaluation_plan_obj=self.pool.get('hr_evaluation.plan') + obj_evaluation = self.pool.get('hr_evaluation.evaluation') flag = False evaluation_plan = evaluation_plan_obj.browse(cr, uid, [evaluation_plan_id], context=context)[0] if not evaluation_date: @@ -192,11 +191,11 @@ class hr_evaluation(osv.osv): return res def onchange_employee_id(self, cr, uid, ids, employee_id, context=None): - employee_obj=self.pool.get('hr.employee') if context is None: context = {} - evaluation_plan_id='' + evaluation_plan_id=False if employee_id: + employee_obj=self.pool.get('hr.employee') for employee in employee_obj.browse(cr, uid, [employee_id], context=context): if employee and employee.evaluation_plan_id and employee.evaluation_plan_id.id: evaluation_plan_id=employee.evaluation_plan_id.id @@ -259,6 +258,7 @@ class hr_evaluation(osv.osv): def button_done(self,cr, uid, ids, context=None): if context is None: context = {} + self.write(cr, uid, ids,{'progress': 1 * 100}, context=context) self.write(cr, uid, ids,{'state':'done', 'date_close': time.strftime('%Y-%m-%d')}, context=context) return True diff --git a/addons/hr_evaluation/hr_evaluation_demo.xml b/addons/hr_evaluation/hr_evaluation_demo.xml index 0a03ec0e0b6..f8513bf63ea 100644 --- a/addons/hr_evaluation/hr_evaluation_demo.xml +++ b/addons/hr_evaluation/hr_evaluation_demo.xml @@ -1616,13 +1616,13 @@ Once the form had been filled, the employee send it to his supervisor. Employee Evaluation [('employee_id.user_id','=',user.id)] - + Manager Evaluation ['|',('employee_id.user_id','=',user.id),('employee_id.parent_id.user_id','=',user.id )] - + diff --git a/addons/hr_evaluation/hr_evaluation_view.xml b/addons/hr_evaluation/hr_evaluation_view.xml index 5dcc7b6f346..e4ccb11ce4e 100644 --- a/addons/hr_evaluation/hr_evaluation_view.xml +++ b/addons/hr_evaluation/hr_evaluation_view.xml @@ -64,7 +64,7 @@ - + @@ -237,7 +237,7 @@ - @@ -246,6 +246,7 @@ + diff --git a/addons/hr_evaluation/report/hr_evaluation_report_view.xml b/addons/hr_evaluation/report/hr_evaluation_report_view.xml index a8aaeb2ec93..59dade23d6f 100644 --- a/addons/hr_evaluation/report/hr_evaluation_report_view.xml +++ b/addons/hr_evaluation/report/hr_evaluation_report_view.xml @@ -18,11 +18,11 @@ + - @@ -75,13 +75,13 @@ - + - - - + + + diff --git a/addons/hr_evaluation/security/ir.model.access.csv b/addons/hr_evaluation/security/ir.model.access.csv index 7c57d67d1cd..fba2a5f2202 100644 --- a/addons/hr_evaluation/security/ir.model.access.csv +++ b/addons/hr_evaluation/security/ir.model.access.csv @@ -1,21 +1,9 @@ "id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" "access_hr_evaluation_evaluation_user","hr_evaluation.evaluation.user","model_hr_evaluation_evaluation","base.group_hr_user",1,1,1,1 -"access_hr_evaluation_evaluation_manager","hr_evaluation.evaluation.manager","model_hr_evaluation_evaluation","base.group_hr_manager",1,1,1,1 -"access_hr_evaluation_plan_user","hr_evaluation.plan.user","model_hr_evaluation_evaluation","base.group_hr_user",1,0,0,0 -"access_hr_evaluation_plan_manager","hr_evaluation.plan.manager","model_hr_evaluation_plan","base.group_hr_manager",1,1,1,1 -"access_hr_evaluation_plan_phase_user","hr_evaluation.plan.phase.user","model_hr_evaluation_plan_phase","base.group_hr_user",1,0,0,0 -"access_hr_evaluation_plan_phase_manager","hr_evaluation.plan.phase.manager","model_hr_evaluation_plan_phase","base.group_hr_manager",1,1,1,1 +"access_hr_evaluation_plan_user","hr_evaluation.plan.user","model_hr_evaluation_plan","base.group_hr_user",1,1,1,1 +"access_hr_evaluation_plan_phase_user","hr_evaluation.plan.phase.user","model_hr_evaluation_plan_phase","base.group_hr_user",1,1,1,1 "access_hr_evaluation_interview_user","hr.evaluation.interview.user","model_hr_evaluation_interview","base.group_hr_user",1,1,1,1 -"access_hr_evaluation_interview_manager","hr.evaluation.interview.manager","model_hr_evaluation_interview","base.group_hr_manager",1,1,1,1 "access_hr_evaluation_report","hr.evaluation.report","model_hr_evaluation_report","base.group_hr_manager",1,1,1,1 -"access_hr_evaluation_plan","hr_evaluation.plan","model_hr_evaluation_plan","base.group_system",1,1,1,1 -"access_hr_evaluation_plan_phase_system","hr_evaluation.plan.phase.system","model_hr_evaluation_plan_phase","base.group_system",1,1,1,1 -"access_hr_evaluation_evaluation_system","hr_evaluation.evaluation.system","model_hr_evaluation_evaluation","base.group_system",1,0,0,0 -"access_hr_evaluation_interview_system","hr.evaluation.interview.system","model_hr_evaluation_interview","base.group_system",1,0,0,0 -"access_hr_evaluation_evaluation_employee","hr_evaluation.evaluation.employee","model_hr_evaluation_evaluation","base.group_user",1,0,0,0 -"access_hr_evaluation_interview_employee","hr.evaluation.interview.employee","model_hr_evaluation_interview","base.group_user",1,0,0,0 -"access_hr_evaluation_user","hr_evaluation.user","model_hr_evaluation_plan","base.group_hr_user",1,1,1,1 -"access_hr_evaluation_employee","hr_evaluation.employee","model_hr_evaluation_plan","base.group_user",1,0,0,0 "access_survey_type_hr_manager","survey.type","survey.model_survey_type","base.group_hr_manager",1,1,1,1 "access_survey_hr_manager","survey.hr.manager","survey.model_survey","base.group_hr_manager",1,1,1,1 "access_survey_history_manager","survey.history","survey.model_survey_history","base.group_hr_manager",1,1,1,1 @@ -28,7 +16,6 @@ "access_survey_tbl_column_heading_hr_manager","survey.tbl.column.heading","survey.model_survey_tbl_column_heading","base.group_hr_manager",1,1,1,1 "access_survey_response_answer_hr_manager","survey.response.answer","survey.model_survey_response_answer","base.group_hr_manager",1,1,1,1 "access_survey_request_hr_manager","survey.request","survey.model_survey_request","base.group_hr_manager",1,1,1,1 -"access_survey_hr_user","survey.hr.user","survey.model_survey","base.group_hr_user",1,1,1,0 "access_survey_answer_hr_user","survey.answer.hr.user","survey.model_survey_answer","base.group_hr_user",1,1,1,0 "access_survey_response_answer_hr_user","survey.response.answer.hr.user","survey.model_survey_response_answer","base.group_hr_user",1,1,1,0 "access_survey_type_hr_user","survey.type.hr.user","survey.model_survey_type","base.group_hr_user",1,1,1,0 diff --git a/addons/hr_expense/board_hr_expense_manager_view.xml b/addons/hr_expense/board_hr_expense_manager_view.xml index 9063ac32458..d86c7614d7f 100644 --- a/addons/hr_expense/board_hr_expense_manager_view.xml +++ b/addons/hr_expense/board_hr_expense_manager_view.xml @@ -9,14 +9,14 @@ [('state','in',('confirm', 'accepted'))] - + board.hr.manager.expense.form board.board - + form - + diff --git a/addons/hr_expense/hr_expense.py b/addons/hr_expense/hr_expense.py index 4003cded168..e9e64f76c4e 100644 --- a/addons/hr_expense/hr_expense.py +++ b/addons/hr_expense/hr_expense.py @@ -97,6 +97,13 @@ class hr_expense_expense(osv.osv): 'currency_id': _get_currency, 'company_id': lambda self, cr, uid, c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id, } + + def onchange_employee_id(self, cr, uid, ids, employee_id, context=None): + if not employee_id: + return {'value':{'department_id': False}} + dept = self.pool.get('hr.employee').browse(cr, uid, employee_id).department_id + return {'value': {'department_id':dept and dept.id or False}} + def expense_confirm(self, cr, uid, ids, *args): self.write(cr, uid, ids, { 'state':'confirm', diff --git a/addons/hr_expense/hr_expense_demo.xml b/addons/hr_expense/hr_expense_demo.xml index c3fa9e90c67..cb9e28b5543 100644 --- a/addons/hr_expense/hr_expense_demo.xml +++ b/addons/hr_expense/hr_expense_demo.xml @@ -108,13 +108,13 @@ Employee Expense [('employee_id.user_id','=',user.id)] - + Manager Expense ['|',('employee_id.user_id','=',user.id),('employee_id.parent_id.user_id','=',user.id )] - + diff --git a/addons/hr_expense/hr_expense_view.xml b/addons/hr_expense/hr_expense_view.xml index 41f87a991c3..7ffdb349826 100644 --- a/addons/hr_expense/hr_expense_view.xml +++ b/addons/hr_expense/hr_expense_view.xml @@ -67,7 +67,7 @@
- + @@ -136,18 +136,22 @@ - + + - + + + @@ -165,7 +169,7 @@ Expenses hr.expense.expense form - {"search_default_user_id":uid,'search_default_this':1} + {"search_default_user_id":uid,"search_default_department_id": department_id,"search_default_this":1} The OpenERP expenses management module allows you to track the full flow. Every month, the employees record their expenses. At the end of the month, their managers validates the expenses sheets which creates costs on projects/analytic accounts. The accountant validates the proposed entries and the employee can be reimbursed. You can also reinvoice the customer at the end of the flow. diff --git a/addons/hr_expense/report/hr_expense_report_view.xml b/addons/hr_expense/report/hr_expense_report_view.xml index 9549e6df576..3de4776b29f 100644 --- a/addons/hr_expense/report/hr_expense_report_view.xml +++ b/addons/hr_expense/report/hr_expense_report_view.xml @@ -65,8 +65,8 @@ - + @@ -82,7 +82,7 @@ - + @@ -99,9 +99,9 @@ - - - + + + diff --git a/addons/hr_expense/security/ir.model.access.csv b/addons/hr_expense/security/ir.model.access.csv index f0208425ba8..525b55bf681 100644 --- a/addons/hr_expense/security/ir.model.access.csv +++ b/addons/hr_expense/security/ir.model.access.csv @@ -1,18 +1,18 @@ "id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" "access_hr_expense_expense_user","hr.expense.expense.user","model_hr_expense_expense","base.group_hr_user",1,1,1,1 -"access_hr_expense_line","hr.expense.line","model_hr_expense_line","base.group_hr_user",1,1,1,1 -"access_hr_expense_report","hr.expense.report","model_hr_expense_report","base.group_hr_manager",1,1,1,1 -"access_product_product_hr_expense","product.product.hr.expense","product.model_product_product","base.group_hr_user",1,0,0,0 -"access_product_template_hr_expense","product.template.hr.expense","product.model_product_template","base.group_hr_user",1,0,0,0 -"access_product_uom_hr_expense","product.uom.hr.expense","product.model_product_uom","base.group_hr_user",1,0,0,0 -"access_product_price_type","product.price.type","product.model_product_price_type","base.group_hr_user",1,1,1,1 -"access_hr_expense_expense_manager","hr.expense.expense.manager","model_hr_expense_expense","base.group_hr_manager",1,1,1,1 -"access_hr_expense_expense_system","hr.expense.expense.system","model_hr_expense_expense","base.group_system",1,0,0,0 -"access_hr_expense_line_manager","hr.expense.line.manager","model_hr_expense_line","base.group_hr_manager",1,1,1,1 -"access_product_product_hr_expense_manager","product.product.hr.expense.manager","product.model_product_product","base.group_hr_manager",1,1,1,1 -"access_product_template_hr_expense_manager","product.template.hr.expense.manager","product.model_product_template","base.group_hr_manager",1,1,1,1 -"access_product_uom_hr_expense_manager","product.uom.hr.expense.manager","product.model_product_uom","base.group_hr_manager",1,1,1,1 -"access_product_price_type_manager","product.price.type.manager","product.model_product_price_type","base.group_hr_manager",1,1,1,1 -"access_hr_expense_expense_employee","hr.expense.expense.employee","model_hr_expense_expense","base.group_user",1,0,0,0 -"access_hr_employee_employee","hr.employee.employee","hr.model_hr_employee","base.group_user",1,0,0,0 -"access_hr_expense_line_employee","hr.expense.line.employee","model_hr_expense_line","base.group_user",1,0,0,0 +"access_hr_expense_line_user","hr.expense.line.user","model_hr_expense_line","base.group_hr_user",1,1,1,1 +"access_hr_expense_report_manager","hr.expense.report.manager","model_hr_expense_report","base.group_hr_manager",1,1,1,1 +"access_product_product_hr_expense_user","product.product.hr.expense.user","product.model_product_product","base.group_hr_user",1,1,1,1 +"access_product_template_hr_expense_user","product.template.hr.expense.user","product.model_product_template","base.group_hr_user",1,1,1,1 +"access_product_uom_hr_expense_user","product.uom.hr.expense.user","product.model_product_uom","base.group_hr_user",1,1,1,1 +"access_product_price_type_user","product.price.type.user","product.model_product_price_type","base.group_hr_user",1,1,1,1 +"access_account_journal_user","account.journal.user","account.model_account_journal","base.group_hr_user",1,1,1,1 +"access_account_invoice_user","account.invoice.user","account.model_account_invoice","base.group_hr_user",1,1,1,1 +"access_account_invoice_line_user","account.invoice.line.user","account.model_account_invoice_line","base.group_hr_user",1,1,1,1 +"access_account_analytic_journal_user","account.ianalytic.journal.user","account.model_account_analytic_journal","base.group_hr_user",1,1,1,1 +"access_account_invoice_tax_user","account.invoice.tax.user","account.model_account_invoice_tax","base.group_hr_user",1,1,1,1 +"access_account_period_user","account.period.user","account.model_account_period","base.group_hr_user",1,1,1,1 +"access_account_fiscalyear_user","account.fiscalyear.user","account.model_account_fiscalyear","base.group_hr_user",1,1,1,1 +"access_account_move_user","account.move.user","account.model_account_move","base.group_hr_user",1,1,1,1 +"access_account_move_line_user","account.move.line.user","account.model_account_move_line","base.group_hr_user",1,1,1,1 +"access_account_analytic_line_user","account.ianalytic.line.user","account.model_account_analytic_line","base.group_hr_user",1,1,1,1 diff --git a/addons/hr_holidays/board_hr_holidays_view.xml b/addons/hr_holidays/board_hr_holidays_view.xml index 8659e3de51d..86786ad1baf 100644 --- a/addons/hr_holidays/board_hr_holidays_view.xml +++ b/addons/hr_holidays/board_hr_holidays_view.xml @@ -2,7 +2,7 @@ - + Employee Holidays [('employee_id.user_id','=',user.id)] - + Manager Holidays ['|',('employee_id.user_id','=',user.id),('employee_id.parent_id.user_id','=',user.id )] - + diff --git a/addons/hr_holidays/hr_holidays_view.xml b/addons/hr_holidays/hr_holidays_view.xml index 12d347cd876..6ee69af1bca 100644 --- a/addons/hr_holidays/hr_holidays_view.xml +++ b/addons/hr_holidays/hr_holidays_view.xml @@ -66,7 +66,7 @@ - + @@ -269,6 +269,7 @@ hr.holidays form + {"search_default_department_id": department_id} [('type','=','remove')] Leaves requests can be recorded by employees and validated by their managers. Once a leave request is validated it appears automatically in the agenda of the employee. You can define several allowance types (paid holidays, sickness, etc) and manage allowances per type. @@ -302,7 +303,7 @@ Allocation Requests hr.holidays form - {'search_default_user_id':uid,'type':'add'} + {'search_default_user_id':uid,'type':'add',"search_default_department_id": department_id} [('type','=','add')] @@ -330,7 +331,7 @@ form tree,form - {'allocation_type':'company', 'report':True} + {'allocation_type':'company', 'report':True,"search_default_department_id": department_id} @@ -379,7 +380,7 @@ tree,form - + + @@ -18,6 +19,7 @@ + @@ -48,13 +50,11 @@ - - - + + + + + @@ -65,13 +65,19 @@ - - - + + + + + + + diff --git a/addons/hr_holidays/report/holidays_summary_report.py b/addons/hr_holidays/report/holidays_summary_report.py index a14970b31e5..92dedd1a14d 100644 --- a/addons/hr_holidays/report/holidays_summary_report.py +++ b/addons/hr_holidays/report/holidays_summary_report.py @@ -100,7 +100,6 @@ class report_custom(report_rml): today=datetime.datetime.today() first_date=data['form']['date_from'] - som = strToDate(first_date) eom = som+datetime.timedelta(59) day_diff=eom-som diff --git a/addons/hr_holidays/report/hr_holidays_report.py b/addons/hr_holidays/report/hr_holidays_report.py index 9a259f1fe15..5d2dc27c0de 100644 --- a/addons/hr_holidays/report/hr_holidays_report.py +++ b/addons/hr_holidays/report/hr_holidays_report.py @@ -64,9 +64,9 @@ class hr_holidays_report(osv.osv): s.employee_id, s.category_id, s.user_id as user_id, - to_char(s.create_date, 'YYYY') as year, - to_char(s.create_date, 'MM') as month, - to_char(s.create_date, 'YYYY-MM-DD') as day, + to_char(s.date_from, 'YYYY') as year, + to_char(s.date_from, 'MM') as month, + to_char(s.date_from, 'YYYY-MM-DD') as day, s.holiday_status_id, s.department_id, s.state, diff --git a/addons/hr_holidays/report/hr_holidays_report_view.xml b/addons/hr_holidays/report/hr_holidays_report_view.xml index 89cdb6014bb..b2fa98a7720 100644 --- a/addons/hr_holidays/report/hr_holidays_report_view.xml +++ b/addons/hr_holidays/report/hr_holidays_report_view.xml @@ -54,7 +54,7 @@ - @@ -75,7 +75,7 @@ - + @@ -85,20 +85,20 @@ - - - + + + - Leaves + Leaves Analysis hr.holidays.report form tree,graph - {"search_default_user_id": uid, 'search_default_month':1, 'search_default_department':1, 'group_by':[], 'group_by_no_leaf':1} + {"search_default_user_id": uid, 'search_default_month':1, 'search_default_Employee':1,'search_default_department':1,"search_default_Validated":1, 'group_by':[], 'group_by_no_leaf':1} diff --git a/addons/hr_holidays/security/ir.model.access.csv b/addons/hr_holidays/security/ir.model.access.csv index 238d526bf5e..20da4832fe2 100644 --- a/addons/hr_holidays/security/ir.model.access.csv +++ b/addons/hr_holidays/security/ir.model.access.csv @@ -1,15 +1,7 @@ "id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" -"access_hr_holydays_status_user","hr.holidays.status user","model_hr_holidays_status","base.group_hr_user",1,0,0,0 -"access_hr_holidays_user","hr.holidays.user","model_hr_holidays","base.group_hr_user",1,1,1,0 -"access_hr_holydays_status_manager","hr.holidays.status.manager","model_hr_holidays_status","base.group_hr_manager",1,1,1,1 -"access_hr_holidays_manager","hr.holidays.manager","model_hr_holidays","base.group_hr_manager",1,1,1,1 -"access_hr_holidays_remain_user","hr.holidays.ramain.user","model_hr_holidays_remaining_leaves_user","base.group_hr_user",1,0,0,0 -"access_hr_holidays_report","hr.holidays.report","model_hr_holidays_report","base.group_hr_manager",1,1,1,1 -"access_hr_holidays_remaining_leaves_manager","hr.hr.holidays.remaining.leaves.manager","model_hr_holidays_remaining_leaves_user","base.group_hr_manager",1,1,1,1 -"access_available_holidays_report","hr.available.holidays.report","model_available_holidays_report","base.group_hr_manager",1,1,1,1 -"access_hr_holydays_status_system","hr.holidays.status.system","model_hr_holidays_status","base.group_system",1,1,1,1 -"access_hr_holidays_system","hr.holidays.system","model_hr_holidays","base.group_system",1,0,0,0 -"access_hr_holidays_employee","hr.holidays.employee","model_hr_holidays","base.group_user",1,0,0,0 -"access_hr_holydays_status_employee","hr.holidays.status.employee","model_hr_holidays_status","base.group_user",1,0,0,0 +"access_hr_holydays_status_user","hr.holidays.status user","model_hr_holidays_status","base.group_hr_user",1,1,1,1 +"access_hr_holidays_user","hr.holidays.user","model_hr_holidays","base.group_hr_user",1,1,1,1 +"access_hr_holidays_remain_user","hr.holidays.ramain.user","model_hr_holidays_remaining_leaves_user","base.group_hr_user",1,1,1,1 +"access_hr_holidays_report_manager","hr.holidays.report.manager","model_hr_holidays_report","base.group_hr_manager",1,1,1,1 "access_resource_calendar_leaves_manager","resource_calendar_leaves_manager","resource.model_resource_calendar_leaves","base.group_hr_manager",1,1,1,1 -"access_available_holidays_report_user","hr.available.holidays.report.user","model_available_holidays_report","base.group_hr_user",1,1,1,0 +"access_available_holidays_report_user","hr.available.holidays.report.user","model_available_holidays_report","base.group_hr_user",1,1,1,1 diff --git a/addons/hr_holidays/wizard/hr_holidays_summary_department.py b/addons/hr_holidays/wizard/hr_holidays_summary_department.py index 9a99d9eff63..5ea75cb7e30 100644 --- a/addons/hr_holidays/wizard/hr_holidays_summary_department.py +++ b/addons/hr_holidays/wizard/hr_holidays_summary_department.py @@ -30,7 +30,7 @@ class hr_holidays_summary_dept(osv.osv_memory): _columns = { 'date_from': fields.date('From', required=True), 'depts': fields.many2many('hr.department', 'summary_dept_rel', 'sum_id', 'dept_id', 'Department(s)'), - 'holiday_type': fields.selection([('Validated','Validated'),('Confirmed','Confirmed'),('both','Both Validated and Confirmed')], 'Select Holiday Type', required=True) + 'holiday_type': fields.selection([('Validated','Validated'),('Confirmed','Confirmed'),('both','Both Validated and Confirmed')], 'Leave Type', required=True) } _defaults = { diff --git a/addons/hr_holidays/wizard/hr_holidays_summary_department_view.xml b/addons/hr_holidays/wizard/hr_holidays_summary_department_view.xml index 01d3f4372ce..cd7665be123 100644 --- a/addons/hr_holidays/wizard/hr_holidays_summary_department_view.xml +++ b/addons/hr_holidays/wizard/hr_holidays_summary_department_view.xml @@ -9,16 +9,15 @@ - + - + - - - - -