diff --git a/addons/hr_attendance/__init__.py b/addons/hr_attendance/__init__.py
index dadb043e016..feb32e22792 100644
--- a/addons/hr_attendance/__init__.py
+++ b/addons/hr_attendance/__init__.py
@@ -22,5 +22,6 @@
import hr_attendance
import wizard
import report
+import res_config
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/hr_attendance/__openerp__.py b/addons/hr_attendance/__openerp__.py
index f47b0900fb6..631880ec73b 100644
--- a/addons/hr_attendance/__openerp__.py
+++ b/addons/hr_attendance/__openerp__.py
@@ -35,14 +35,14 @@ actions(Sign in/Sign out) performed by them.
'images': ['images/hr_attendances.jpeg'],
'depends': ['hr'],
'data': [
+ 'security/ir_rule.xml',
'security/ir.model.access.csv',
'hr_attendance_view.xml',
'hr_attendance_report.xml',
- 'security/ir.model.access.csv',
- 'security/ir_rule.xml',
'wizard/hr_attendance_bymonth_view.xml',
'wizard/hr_attendance_byweek_view.xml',
'wizard/hr_attendance_error_view.xml',
+ 'res_config_view.xml',
],
'demo': ['hr_attendance_demo.xml'],
'test': [
diff --git a/addons/hr_attendance/hr_attendance.py b/addons/hr_attendance/hr_attendance.py
index 8fdd2928fe6..a2ee3650a2f 100644
--- a/addons/hr_attendance/hr_attendance.py
+++ b/addons/hr_attendance/hr_attendance.py
@@ -126,9 +126,18 @@ class hr_employee(osv.osv):
result[id] = res[0]
return result
+ def _attendance_access(self, cr, uid, ids, name, args, context=None):
+ # this function field use to hide attendance button to singin/singout from menu
+ group = self.pool.get('ir.model.data').get_object(cr, uid, 'base', 'group_hr_attendance')
+ visible = False
+ if uid in [user.id for user in group.users]:
+ visible = True
+ return dict([(x, visible) for x in ids])
+
_columns = {
'state': fields.function(_state, type='selection', selection=[('absent', 'Absent'), ('present', 'Present')], string='Attendance'),
'last_sign': fields.function(_last_sign, type='datetime', string='Last Sign'),
+ 'attendance_access': fields.function(_attendance_access, type='boolean'),
}
def _action_check(self, cr, uid, emp_id, dt=False, context=None):
diff --git a/addons/hr_attendance/hr_attendance_view.xml b/addons/hr_attendance/hr_attendance_view.xml
index c686b4c1ff0..c38ee45b510 100644
--- a/addons/hr_attendance/hr_attendance_view.xml
+++ b/addons/hr_attendance/hr_attendance_view.xml
@@ -76,9 +76,9 @@
-
+
-
+
hr.action.reason.form
@@ -114,9 +114,8 @@
-
+ sequence="35" id="hr.menu_open_view_attendance_reason_new_config" parent="hr.menu_hr_configuration" groups="base.group_hr_attendance" name="Attendance"/>
+
hr.employee.form1
@@ -124,8 +123,8 @@
-
-
+
+
-
diff --git a/addons/hr_attendance/res_config.py b/addons/hr_attendance/res_config.py
new file mode 100644
index 00000000000..0da2d183409
--- /dev/null
+++ b/addons/hr_attendance/res_config.py
@@ -0,0 +1,33 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Business Applications
+# Copyright (C) 2004-2012 OpenERP S.A. ().
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see .
+#
+##############################################################################
+
+from osv import fields, osv
+
+class hr_attendance_config_settings(osv.osv_memory):
+ _inherit = 'hr.config.settings'
+
+ _columns = {
+ 'group_hr_attendance': fields.boolean('Track attendances',
+ implied_group='base.group_hr_attendance',
+ help="Allocates attendance group to all users."),
+ }
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/hr_attendance/res_config_view.xml b/addons/hr_attendance/res_config_view.xml
new file mode 100644
index 00000000000..252672ad86d
--- /dev/null
+++ b/addons/hr_attendance/res_config_view.xml
@@ -0,0 +1,20 @@
+
+
+
+
+ hr.config.settings.inherit
+ hr.config.settings
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/addons/hr_attendance/security/ir_rule.xml b/addons/hr_attendance/security/ir_rule.xml
index b934dc16f5a..e08af0644bc 100644
--- a/addons/hr_attendance/security/ir_rule.xml
+++ b/addons/hr_attendance/security/ir_rule.xml
@@ -2,6 +2,11 @@
+
+ Attendances
+
+
+
Manager Attendance
diff --git a/addons/hr_attendance/static/src/js/attendance.js b/addons/hr_attendance/static/src/js/attendance.js
index 1b5e271b4ba..d92e7534786 100644
--- a/addons/hr_attendance/static/src/js/attendance.js
+++ b/addons/hr_attendance/static/src/js/attendance.js
@@ -57,9 +57,12 @@ openerp.hr_attendance = function (instance) {
var employee = new instance.web.DataSetSearch(self, 'hr.employee', self.session.user_context, [
['user_id', '=', self.session.uid]
]);
- return employee.read_slice(['id', 'name', 'state', 'last_sign']).pipe(function (res) {
- if (_.isEmpty(res))
+ return employee.read_slice(['id', 'name', 'state', 'last_sign', 'attendance_access']).pipe(function (res) {
+ if (_.isEmpty(res) )
return;
+ if (res[0].attendance_access == false){
+ return;
+ }
self.$el.show();
self.employee = res[0];
self.last_sign = instance.web.str_to_datetime(self.employee.last_sign);
diff --git a/addons/hr_contract/hr_contract_view.xml b/addons/hr_contract/hr_contract_view.xml
index 6566f303d36..0659d661420 100644
--- a/addons/hr_contract/hr_contract_view.xml
+++ b/addons/hr_contract/hr_contract_view.xml
@@ -5,13 +5,13 @@
-
+
+ hr.contract
+ form
+ Contracts
+ tree,form
+ {'search_default_employee_id': [active_id], 'default_employee_id': active_id}
+
diff --git a/addons/hr_evaluation/hr_evaluation.py b/addons/hr_evaluation/hr_evaluation.py
index 3508dc36d49..d0da22c5681 100644
--- a/addons/hr_evaluation/hr_evaluation.py
+++ b/addons/hr_evaluation/hr_evaluation.py
@@ -141,6 +141,7 @@ hr_employee()
class hr_evaluation(osv.osv):
_name = "hr_evaluation.evaluation"
+ _inherit = "mail.thread"
_description = "Employee Appraisal"
_rec_name = 'employee_id'
_columns = {
@@ -242,8 +243,10 @@ class hr_evaluation(osv.osv):
def button_final_validation(self, cr, uid, ids, context=None):
request_obj = self.pool.get('hr.evaluation.interview')
self.write(cr, uid, ids, {'state':'progress'}, context=context)
- for id in self.browse(cr, uid, ids, context=context):
- if len(id.survey_request_ids) != len(request_obj.search(cr, uid, [('evaluation_id', '=', id.id),('state', 'in', ['done','cancel'])], context=context)):
+ for evaluation in self.browse(cr, uid, ids, context=context):
+ if evaluation.employee_id and evaluation.employee_id.parent_id and evaluation.employee_id.parent_id.user_id:
+ self.message_subscribe_users(cr, uid, [evaluation.id], user_ids=[evaluation.employee_id.parent_id.user_id.id], context=context)
+ if len(evaluation.survey_request_ids) != len(request_obj.search(cr, uid, [('evaluation_id', '=', evaluation.id),('state', 'in', ['done','cancel'])], context=context)):
raise osv.except_osv(_('Warning!'),_("You cannot change state, because some appraisal(s) are in waiting answer or draft state."))
return True
@@ -263,6 +266,10 @@ class hr_evaluation(osv.osv):
return True
def write(self, cr, uid, ids, vals, context=None):
+ if vals.get('employee_id'):
+ employee_id = self.pool.get('hr.employee').browse(cr, uid, vals.get('employee_id'), context=context)
+ if employee_id.parent_id and employee_id.parent_id.user_id:
+ vals['message_follower_ids'] = [(4, employee_id.parent_id.user_id.partner_id.id)]
if 'date' in vals:
new_vals = {'date_deadline': vals.get('date')}
obj_hr_eval_iterview = self.pool.get('hr.evaluation.interview')
diff --git a/addons/hr_evaluation/hr_evaluation_view.xml b/addons/hr_evaluation/hr_evaluation_view.xml
index 29d68d7a12c..ca90e98e516 100644
--- a/addons/hr_evaluation/hr_evaluation_view.xml
+++ b/addons/hr_evaluation/hr_evaluation_view.xml
@@ -58,6 +58,16 @@
formtree,form
+
+
+
+
+ hr.evaluation.interview
+ form
+ Interviews
+ tree,form
+ {'search_default_user_to_review_id': [active_id], 'default_user_to_review_id': active_id}
+
@@ -134,6 +144,9 @@
+
+
+
@@ -196,6 +209,10 @@
+
+
+
+
@@ -408,13 +425,5 @@
'default_body_text': 'Hello,\n\nKindly post your response for the survey interview.\n\nThanks',
'default_subject': 'Reminder to fill up Survey'}"/>
-
-
-
diff --git a/addons/hr_expense/hr_expense.py b/addons/hr_expense/hr_expense.py
index 83f986e59cc..91dc44fed61 100644
--- a/addons/hr_expense/hr_expense.py
+++ b/addons/hr_expense/hr_expense.py
@@ -118,6 +118,9 @@ class hr_expense_expense(osv.osv):
return {'value': {'department_id': department_id, 'company_id': company_id}}
def expense_confirm(self, cr, uid, ids, *args):
+ for expense in self.browse(cr, uid, ids):
+ if expense.employee_id and expense.employee_id.parent_id.user_id:
+ self.message_subscribe_users(cr, uid, [expense.id], user_ids=[expense.employee_id.parent_id.user_id.id])
self.write(cr, uid, ids, {
'state':'confirm',
'date_confirm': time.strftime('%Y-%m-%d')
diff --git a/addons/hr_expense/hr_expense_view.xml b/addons/hr_expense/hr_expense_view.xml
index d9efa612c0b..388e5262f6e 100644
--- a/addons/hr_expense/hr_expense_view.xml
+++ b/addons/hr_expense/hr_expense_view.xml
@@ -195,12 +195,10 @@
product.product
-
-
+
-
-
+
diff --git a/addons/hr_holidays/hr_holidays.py b/addons/hr_holidays/hr_holidays.py
index 759170224bd..76d4e42818a 100644
--- a/addons/hr_holidays/hr_holidays.py
+++ b/addons/hr_holidays/hr_holidays.py
@@ -303,7 +303,7 @@ class hr_holidays(osv.osv):
self.check_holidays(cr, uid, ids, context=context)
for record in self.browse(cr, uid, ids, context=context):
if record.employee_id and record.employee_id.parent_id and record.employee_id.parent_id.user_id:
- self.message_subscribe(cr, uid, [record.id], user_ids=[record.employee_id.parent_id.user_id.id], context=context)
+ self.message_subscribe_users(cr, uid, [record.id], user_ids=[record.employee_id.parent_id.user_id.id], context=context)
self.holidays_confirm_notificate(cr, uid, ids, context=context)
return self.write(cr, uid, ids, {'state':'confirm'})
diff --git a/addons/hr_payroll/hr_payroll_view.xml b/addons/hr_payroll/hr_payroll_view.xml
index ef3c0ea2e9f..3ba9467395e 100644
--- a/addons/hr_payroll/hr_payroll_view.xml
+++ b/addons/hr_payroll/hr_payroll_view.xml
@@ -369,14 +369,16 @@
-
-
+
+
+
+
+ hr.payslip
+ Payslips
+ form
+ tree,form
+ {'search_default_employee_id': [active_id], 'default_employee_id': active_id}
+
diff --git a/addons/hr_timesheet_invoice/report/hr_timesheet_invoice_report_view.xml b/addons/hr_timesheet_invoice/report/hr_timesheet_invoice_report_view.xml
index 2d4b0debde8..6d6fe2f3776 100644
--- a/addons/hr_timesheet_invoice/report/hr_timesheet_invoice_report_view.xml
+++ b/addons/hr_timesheet_invoice/report/hr_timesheet_invoice_report_view.xml
@@ -347,18 +347,11 @@
src_model="res.users"/>
-
-
+ context="{'search_default_manager_id': [active_id]}"
+ id="act_res_users_2_report_timesheet_invoice"
+ name="Costs to invoice"
+ res_model="report_timesheet.invoice"
+ src_model="res.users"/>
diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py
index fcdbfda0667..13c11cf72c7 100644
--- a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py
+++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py
@@ -103,6 +103,7 @@ class one2many_mod(fields.one2many):
class hr_timesheet_sheet(osv.osv):
_name = "hr_timesheet_sheet.sheet"
+ _inherit = "mail.thread"
_table = 'hr_timesheet_sheet_sheet'
_order = "id desc"
_description="Timesheet"
@@ -265,6 +266,8 @@ class hr_timesheet_sheet(osv.osv):
def button_confirm(self, cr, uid, ids, context=None):
for sheet in self.browse(cr, uid, ids, context=context):
+ if sheet.employee_id and sheet.employee_id.parent_id and sheet.employee_id.parent_id.user_id:
+ self.message_subscribe_users(cr, uid, [sheet.id], user_ids=[sheet.employee_id.parent_id.user_id.id], context=context)
self.check_employee_attendance_state(cr, uid, sheet.id, context=context)
di = sheet.user_id.company_id.timesheet_max_difference
if (abs(sheet.total_difference) < di) or not di:
diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml b/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml
index 6c92e28564e..9a7416464af 100644
--- a/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml
+++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml
@@ -64,9 +64,9 @@
-
+
-
+
@@ -84,7 +84,7 @@