@@ -367,10 +378,23 @@
-
-
-
-
+
+
+
+
+
+
diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py
index 9226787e908..2560590a7f8 100644
--- a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py
+++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py
@@ -103,6 +103,18 @@ class hr_timesheet_sheet(osv.osv):
for sheet in self.browse(cr, uid, ids, context=context):
if sheet.employee_id.id not in employee_ids: employee_ids.append(sheet.employee_id.id)
return hr_employee.attendance_action_change(cr, uid, employee_ids, context=context)
+
+ def _count_all(self, cr, uid, ids, field_name, arg, context=None):
+ res = dict(map(lambda x: (x,{'timesheet_count': 0, 'attendance_count': 0,}), ids))
+ try:
+ for datas in self.browse(cr, uid, ids, context=context):
+ res[datas.id] = {'appraisal_count': len(datas.appraisal_ids),
+ 'timesheet_count': len(datas.timesheet_ids),
+ 'attendance_count': len(datas.attendances_ids),
+ }
+ except:
+ pass
+ return res
_columns = {
'name': fields.char('Note', size=64, select=1,
@@ -134,6 +146,8 @@ class hr_timesheet_sheet(osv.osv):
'account_ids': fields.one2many('hr_timesheet_sheet.sheet.account', 'sheet_id', 'Analytic accounts', readonly=True),
'company_id': fields.many2one('res.company', 'Company'),
'department_id':fields.many2one('hr.department','Department'),
+ 'timesheet_count': fields.function(_count_all, type='integer', string='Timesheet Activities', multi=True),
+ 'attendance_count': fields.function(_count_all, type='integer', string="Attendances", multi=True),
}
def _default_date_from(self, cr, uid, context=None):
diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml b/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml
index 644586ec502..fd7570c17df 100644
--- a/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml
+++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml
@@ -73,7 +73,10 @@
+ class="oe_stat_button"
+ icon="fa-times">
+
+
@@ -365,7 +368,13 @@
-
+