From 1f75156bd3faaa9c88194a555bd8bd17534a15eb Mon Sep 17 00:00:00 2001 From: Yannick Tivisse Date: Mon, 8 Aug 2016 14:19:45 +0200 Subject: [PATCH] [FIX] hr_timesheet_sheet: linting issue --- .../models/hr_timesheet_sheet.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/addons/hr_timesheet_sheet/models/hr_timesheet_sheet.py b/addons/hr_timesheet_sheet/models/hr_timesheet_sheet.py index 9857b9d49c4..caf3dc2d8bf 100644 --- a/addons/hr_timesheet_sheet/models/hr_timesheet_sheet.py +++ b/addons/hr_timesheet_sheet/models/hr_timesheet_sheet.py @@ -62,9 +62,9 @@ class HrTimesheetSheet(models.Model): ('confirm', 'Waiting Approval'), ('done', 'Approved')], default='new', track_visibility='onchange', string='Status', required=True, readonly=True, index=True, - help=' * The \'Open\' status is used when a user is encoding a new and unconfirmed timesheet. \ - \n* The \'Waiting Approval\' status is used to confirm the timesheet by user. \ - \n* The \'Approved\' status is used when the users timesheet is accepted by his/her senior.') + help=' * The \'Open\' status is used when a user is encoding a new and unconfirmed timesheet. ' + '\n* The \'Waiting Approval\' status is used to confirm the timesheet by user. ' + '\n* The \'Approved\' status is used when the users timesheet is accepted by his/her senior.') account_ids = fields.One2many('hr_timesheet_sheet.sheet.account', 'sheet_id', string='Analytic accounts', readonly=True) company_id = fields.Many2one('res.company', string='Company') department_id = fields.Many2one('hr.department', string='Department', @@ -75,11 +75,13 @@ class HrTimesheetSheet(models.Model): for sheet in self: new_user_id = forced_user_id or sheet.user_id and sheet.user_id.id if new_user_id: - self.env.cr.execute('SELECT id \ - FROM hr_timesheet_sheet_sheet \ - WHERE (date_from <= %s and %s <= date_to) \ - AND user_id=%s \ - AND id <> %s', (sheet.date_to, sheet.date_from, new_user_id, sheet.id)) + self.env.cr.execute(''' + SELECT id + FROM hr_timesheet_sheet_sheet + WHERE (date_from <= %s and %s <= date_to) + AND user_id=%s + AND id <> %s''', + (sheet.date_to, sheet.date_from, new_user_id, sheet.id)) if any(self.env.cr.fetchall()): raise ValidationError('You cannot have 2 timesheets that overlap!\nPlease use the menu \'My Current Timesheet\' to avoid this problem.')