diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py index 9a4b15945b7..92625f278f8 100644 --- a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py +++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py @@ -297,6 +297,8 @@ class account_analytic_line(osv.osv): sheet_obj = self.pool.get('hr_timesheet_sheet.sheet') res = {}.fromkeys(ids, False) for ts_line in self.browse(cursor, user, ids, context=context): + if not ts_line.is_timesheet: + continue sheet_ids = sheet_obj.search(cursor, user, [('date_to', '>=', ts_line.date), ('date_from', '<=', ts_line.date), ('employee_id.user_id', '=', ts_line.user_id.id), diff --git a/addons/hr_timesheet_sheet/test/test_hr_timesheet_sheet.yml b/addons/hr_timesheet_sheet/test/test_hr_timesheet_sheet.yml index 774467e04a3..ffe000bacf1 100644 --- a/addons/hr_timesheet_sheet/test/test_hr_timesheet_sheet.yml +++ b/addons/hr_timesheet_sheet/test/test_hr_timesheet_sheet.yml @@ -47,6 +47,7 @@ amount: -90.00 product_id: product.product_product_1 general_account_id: a_expense + is_timesheet: !eval True - I confirm my Timesheet at end of period by click on "Confirm" button, if the difference between Timesheet hour and attendance hour is more than 1 hour it will give message. @@ -75,6 +76,7 @@ amount: -90.00 product_id: product.product_product_1 general_account_id: a_expense + is_timesheet: !eval True - I set an allowed difference of 1 hour -