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 @@
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 @@
-
+
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 @@
- 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 @@
@@ -42,4 +41,4 @@
icon="STOCK_PRINT"/>
-
\ No newline at end of file
+
diff --git a/addons/hr_recruitment/hr_recruitment.py b/addons/hr_recruitment/hr_recruitment.py
index b9241477409..3dbcd946e87 100644
--- a/addons/hr_recruitment/hr_recruitment.py
+++ b/addons/hr_recruitment/hr_recruitment.py
@@ -181,15 +181,15 @@ class hr_applicant(crm.crm_case, osv.osv):
}
def onchange_job(self,cr, uid, ids, job, context=None):
- job_obj = self.pool.get('hr.job')
if context is None:
context = {}
result = {}
if job:
+ job_obj = self.pool.get('hr.job')
result['department_id'] = job_obj.browse(cr, uid, job, context=context).department_id.id
return {'value': result}
- return {'value': {'department_id': []}}
+ return {'value': {'department_id': False}}
def stage_previous(self, cr, uid, ids, context=None):
"""This function computes previous stage for case from its current stage
@@ -437,8 +437,9 @@ class hr_applicant(crm.crm_case, osv.osv):
emp_id = employee_obj.create(cr,uid,{'name':applicant.name,'job_id':applicant.job_id.id})
job_data = job_obj.browse(cr,uid, applicant.job_id.id)
expected_emp = job_data['expected_employees'] - 1
- job_obj.write(cr,uid, [applicant.job_id.id],{'expected_employees':expected_emp,'state': 'old'})
-
+ if expected_emp == 0:
+ job_obj.write(cr,uid, [applicant.job_id.id],{'state':'old'})
+ job_obj.write(cr,uid, [applicant.job_id.id],{'expected_employees':expected_emp})
return res
def case_reset(self, cr, uid, ids, *args):
@@ -449,8 +450,18 @@ class hr_applicant(crm.crm_case, osv.osv):
@param ids: List of case Ids
@param *args: Tuple Value for additional Params
"""
+ applicant = self.browse(cr, uid, ids)[0]
+ if applicant.job_id :
+ job_obj = self.pool.get('hr.job')
+ emp_obj = self.pool.get('hr.employee')
+ job_data = job_obj.browse(cr,uid, applicant.job_id.id)
+ expected_emp = job_data['expected_employees'] + 1
+ emp_id = emp_obj.search(cr,uid, [('job_id','=',applicant.job_id.id),('name','=',applicant.name)])
+ emp_obj.unlink(cr, uid, emp_id)
+ job_obj.write(cr,uid, [applicant.job_id.id],{'expected_employees':expected_emp})
res = super(hr_applicant, self).case_reset(cr, uid, ids, *args)
self.write(cr, uid, ids, {'date_open': False, 'date_closed':False})
+
return res
diff --git a/addons/hr_recruitment/hr_recruitment_menu.xml b/addons/hr_recruitment/hr_recruitment_menu.xml
index 21f9074545a..7c158bb8795 100644
--- a/addons/hr_recruitment/hr_recruitment_menu.xml
+++ b/addons/hr_recruitment/hr_recruitment_menu.xml
@@ -8,7 +8,7 @@
hr.applicant
tree,form,graph,calendar
- {"search_default_user_id":uid, 'search_default_current': 1}
+ {"search_default_user_id":uid, 'search_default_current': 1,"search_default_department_id": department_id}
diff --git a/addons/hr_recruitment/hr_recruitment_view.xml b/addons/hr_recruitment/hr_recruitment_view.xml
index 3da942873b6..edd3bd77599 100644
--- a/addons/hr_recruitment/hr_recruitment_view.xml
+++ b/addons/hr_recruitment/hr_recruitment_view.xml
@@ -114,7 +114,7 @@
-
+
diff --git a/addons/hr_recruitment/report/hr_recruitment_report_view.xml b/addons/hr_recruitment/report/hr_recruitment_report_view.xml
index d1f06577fb2..d29ecabefb0 100644
--- a/addons/hr_recruitment/report/hr_recruitment_report_view.xml
+++ b/addons/hr_recruitment/report/hr_recruitment_report_view.xml
@@ -67,7 +67,7 @@
icon="terp-document-new"
domain="[('state','=','draft')]"
help = "Draft recruitment"/>
-
@@ -91,36 +91,33 @@
-
-
+
-
-
-
+
-
+
+
-
-
-
-
+
+
+
-
+
diff --git a/addons/hr_recruitment/security/ir.model.access.csv b/addons/hr_recruitment/security/ir.model.access.csv
index 92dc912180d..5e343a40fa0 100644
--- a/addons/hr_recruitment/security/ir.model.access.csv
+++ b/addons/hr_recruitment/security/ir.model.access.csv
@@ -3,8 +3,7 @@
"access_hr_recruitment_report","hr.recruitment.report","model_hr_recruitment_report","base.group_hr_manager",1,1,1,1
"access_hr_recruitment_stage_user","hr.recruitment.stage.user","model_hr_recruitment_stage","base.group_hr_user",1,1,1,1
"access_hr_recruitment_degree","hr.recruitment.degree","model_hr_recruitment_degree","base.group_hr_user",1,1,1,1
-"access_hr_recruitment_stage_system","hr.recruitment.stage.system","model_hr_recruitment_stage","base.group_system",1,1,1,1
-"access_hr_applicant_manager","hr.applicant.manager","model_hr_applicant","base.group_hr_manager",1,1,1,1
-"access_hr_applicant_system","hr.applicant.system","model_hr_applicant","base.group_system",1,0,0,0
-"access_hr_recruitment_stage_manager","hr.recruitment.stage.manager","model_hr_recruitment_stage","base.group_hr_manager",1,1,1,1
-"access_hr_recruitment_degree_manager","hr.recruitment.degree.manager","model_hr_recruitment_degree","base.group_hr_manager",1,1,1,1
+"access_mailgate_message_user","mailgate.message.user","mail_gateway.model_mailgate_message","base.group_hr_user",1,1,1,1
+"access_res_partner_hr_user","res.partner.user","base.model_res_partner","base.group_hr_user",1,1,1,1
+"access_res_partner_address_hr_user","res.partner.address.user","base.model_res_partner_address","base.group_hr_user",1,1,1,1
+"access_survey_hr_user","survey.hr.user","survey.model_survey","base.group_hr_user",1,1,1,0
diff --git a/addons/hr_timesheet/report/user_timesheet.py b/addons/hr_timesheet/report/user_timesheet.py
index dc048748f46..93c425af995 100644
--- a/addons/hr_timesheet/report/user_timesheet.py
+++ b/addons/hr_timesheet/report/user_timesheet.py
@@ -63,7 +63,7 @@ class report_custom(report_rml):
"and product_uom_id = unit.id "\
"and line.user_id=%s and line.date >= %s and line.date < %s "
"order by line.date",
- (data['form']['user_id'], som.strftime('%Y-%m-%d'), eom.strftime('%Y-%m-%d')))
+ (uid, som.strftime('%Y-%m-%d'), eom.strftime('%Y-%m-%d')))
# Sum attendence by account, then by day
accounts = {}
@@ -97,7 +97,7 @@ class report_custom(report_rml):
account_xml.append('')
# Computing the employee
- cr.execute("select name from res_users where id=%s", (data['form']['user_id'],))
+ cr.execute("select name from res_users where id=%s", (str(uid)))
emp = cr.fetchone()[0]
# Computing the xml
diff --git a/addons/hr_timesheet/report/users_timesheet.py b/addons/hr_timesheet/report/users_timesheet.py
index 35c86fd08b9..5a52e9ce9c8 100644
--- a/addons/hr_timesheet/report/users_timesheet.py
+++ b/addons/hr_timesheet/report/users_timesheet.py
@@ -59,7 +59,7 @@ def emp_create_xml(cr, id, som, eom):
time_xml = ([xml % (day, amount) for day, amount in month.iteritems()])
# Computing the employee
- cr.execute("select name from res_users where id=%s", (id,))
+ cr.execute("select name from resource_resource where id=%s", (id,))
emp = cr.fetchone()[0]
# Computing the xml
@@ -91,9 +91,11 @@ class report_custom(report_rml):
date_xml.append('2.5cm%s,2cm\n' % (',0.7cm' * lengthmonth(som.year, som.month)))
emp_xml=''
- for id in data['form']['user_ids']:
- emp_xml += emp_create_xml(cr, id, som, eom)
-
+ emp_obj = pooler.get_pool(cr.dbname).get('hr.employee')
+ for id in data['form']['employee_ids']:
+ user = emp_obj.browse(cr, uid, id).user_id.id
+ if user:
+ emp_xml += emp_create_xml(cr, id, som, eom)
# Computing the xml
#Without this, report don't show non-ascii characters (TO CHECK)
date_xml = '\n'.join(date_xml)
diff --git a/addons/hr_timesheet/security/ir.model.access.csv b/addons/hr_timesheet/security/ir.model.access.csv
index 2b01017fb65..40ac84200ef 100644
--- a/addons/hr_timesheet/security/ir.model.access.csv
+++ b/addons/hr_timesheet/security/ir.model.access.csv
@@ -1,16 +1,8 @@
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_hr_analytic_timesheet","hr.analytic.timesheet","model_hr_analytic_timesheet","base.group_hr_user",1,1,1,1
-"access_hr_account_analytic_line","account.account.analytic.line","account.model_account_analytic_line","base.group_hr_user",1,1,1,0
-"access_account_analytic_journal","account.account.analytic.journal","account.model_account_analytic_journal","base.group_hr_user",1,0,0,0
-"access_product_product_user","product.product user","product.model_product_product","base.group_hr_user",1,0,0,0
-"access_product_template_hr_timesheet","product.template.hr.timesheet","product.model_product_template","base.group_hr_user",1,0,0,0
-"access_product_uom_hr_timesheet","product.uom.hr.timesheet","product.model_product_uom","base.group_hr_user",1,0,0,0
-"access_hr_analytic_timesheet_manager","hr.analytic.timesheet.manager","model_hr_analytic_timesheet","base.group_hr_manager",1,1,1,1
-"access_hr_analytic_timesheet_system","hr.analytic.timesheet.system","model_hr_analytic_timesheet","base.group_system",1,0,0,0
-"access_hr_account_analytic_line_manager","account.account.analytic.line.manager","account.model_account_analytic_line","base.group_hr_manager",1,1,1,1
-"access_account_analytic_journal_manager","account.account.analytic.journal.manager","account.model_account_analytic_journal","base.group_hr_manager",1,1,1,1
-"access_product_product_manager","product.product.manager","product.model_product_product","base.group_hr_manager",1,1,1,1
-"access_product_template_hr_timesheet_manager","product.template.hr.timesheet.manager","product.model_product_template","base.group_hr_manager",1,1,1,1
-"access_product_uom_hr_timesheet_manager","product.uom.hr.timesheet.manager","product.model_product_uom","base.group_hr_manager",1,1,1,1
-"access_hr_analytic_timesheet_employee","hr.analytic.timesheet.employee","model_hr_analytic_timesheet","base.group_user",1,1,1,0
-"access_account_analytic_line_user","account.account.analytic.line.user","account.model_account_analytic_line","base.group_user",1,0,0,0
+"access_hr_account_analytic_line","account.account.analytic.line","account.model_account_analytic_line","base.group_hr_user",1,1,1,1
+"access_account_analytic_journal","account.account.analytic.journal","account.model_account_analytic_journal","base.group_hr_user",1,1,1,1
+"access_product_product_user","product.product user","product.model_product_product","base.group_hr_user",1,1,1,1
+"access_product_template_hr_timesheet","product.template.hr.timesheet","product.model_product_template","base.group_hr_user",1,1,1,1
+"access_product_uom_hr_timesheet","product.uom.hr.timesheet","product.model_product_uom","base.group_hr_user",1,1,1,1
+"access_account_fiscalyear_hr_user","account.account.fiscalyear.user","account.model_account_fiscalyear","base.group_hr_user",1,1,1,1
diff --git a/addons/hr_timesheet/test/hr_timesheet_report.yml b/addons/hr_timesheet/test/hr_timesheet_report.yml
index 2f19f75618f..b1cd445a35d 100644
--- a/addons/hr_timesheet/test/hr_timesheet_report.yml
+++ b/addons/hr_timesheet/test/hr_timesheet_report.yml
@@ -5,7 +5,7 @@
import netsvc, tools, os, time
month = time.gmtime()[1]
year = time.gmtime()[0]
- data_dict = {'model': 'ir.ui.menu', 'form': {'month': month, 'year' : year, 'user_id' : uid }}
+ data_dict = {'model': 'ir.ui.menu', 'form': {'month': month, 'year' : year, 'employee_id' : ref('hr.employee1') }}
(data, format) = netsvc.LocalService('report.hr.analytical.timesheet').create(cr, uid, [], data_dict, {})
if tools.config['test_report_directory']:
file(os.path.join(tools.config['test_report_directory'], 'hr_timesheet-user_report.'+format), 'wb+').write(data)
@@ -17,7 +17,7 @@
import netsvc, tools, os, time
month = time.gmtime()[1]
year = time.gmtime()[0]
- data_dict = {'model': 'ir.ui.menu', 'form': {'month': month, 'year' : year, 'user_ids' : [uid] }}
+ data_dict = {'model': 'ir.ui.menu', 'form': {'month': month, 'year' : year, 'employee_ids' : [ref('hr.employee1')] }}
(data, format) = netsvc.LocalService('report.hr.analytical.timesheet_users').create(cr, uid, [], data_dict, {})
if tools.config['test_report_directory']:
- file(os.path.join(tools.config['test_report_directory'], 'hr_timesheet-users_report.'+format), 'wb+').write(data)
\ No newline at end of file
+ file(os.path.join(tools.config['test_report_directory'], 'hr_timesheet-users_report.'+format), 'wb+').write(data)
diff --git a/addons/hr_timesheet/test/test_hr_timesheet.yml b/addons/hr_timesheet/test/test_hr_timesheet.yml
index d962c627cdd..18d94edbed8 100644
--- a/addons/hr_timesheet/test/test_hr_timesheet.yml
+++ b/addons/hr_timesheet/test/test_hr_timesheet.yml
@@ -21,7 +21,6 @@
context_lang: en_US
groups_id:
- base.group_hr_user
- - base.group_hr_attendance
- base.group_user
- base.group_extended
- base.group_hr_manager
diff --git a/addons/hr_timesheet/wizard/hr_timesheet_print_employee.py b/addons/hr_timesheet/wizard/hr_timesheet_print_employee.py
index 4bcdb614e2f..2983166ad56 100644
--- a/addons/hr_timesheet/wizard/hr_timesheet_print_employee.py
+++ b/addons/hr_timesheet/wizard/hr_timesheet_print_employee.py
@@ -21,6 +21,7 @@
import datetime
from osv import osv, fields
+from tools.translate import _
class analytical_timesheet_employee(osv.osv_memory):
_name = 'hr.analytical.timesheet.employee'
@@ -29,18 +30,24 @@ class analytical_timesheet_employee(osv.osv_memory):
'month': fields.selection([(x, datetime.date(2000, x, 1).strftime('%B')) for x in range(1, 13)],
'Month', required=True),
'year': fields.integer('Year', required=True),
- 'user_id': fields.many2one('res.users', 'User', required=True)
+ 'employee_id': fields.many2one('hr.employee', 'Employee', required=True)
+
}
def _get_user(self, cr, uid, context=None):
+
+ emp_obj = self.pool.get('hr.employee')
if context is None:
context = {}
- return uid
+ emp_id = emp_obj.search(cr, uid, [('user_id', '=', uid)], context=context)
+ if not emp_id:
+ raise osv.except_osv(_("Warning"), _("No employee defined for this user"))
+ return emp_id and emp_id[0] or False
_defaults = {
'month': datetime.date.today().month,
'year': datetime.date.today().year,
- 'user_id': _get_user
+ 'employee_id': _get_user
}
def print_report(self, cr, uid, ids, context=None):
@@ -59,4 +66,4 @@ class analytical_timesheet_employee(osv.osv_memory):
}
analytical_timesheet_employee()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/hr_timesheet/wizard/hr_timesheet_print_employee_view.xml b/addons/hr_timesheet/wizard/hr_timesheet_print_employee_view.xml
index 3b110b52f1d..63e493cfab7 100644
--- a/addons/hr_timesheet/wizard/hr_timesheet_print_employee_view.xml
+++ b/addons/hr_timesheet/wizard/hr_timesheet_print_employee_view.xml
@@ -8,12 +8,11 @@
hr.analytical.timesheet.employee
form
-