From da43da8f3b54be5c4e5392f567d51057d2b250c9 Mon Sep 17 00:00:00 2001 From: "Ajay Chauhan (OpenERP)" Date: Thu, 31 Jan 2013 14:54:40 +0530 Subject: [PATCH] [IMP] hr_timesheet_sheet: use the new signal_xxx methods instead of trg_validate. bzr revid: cha@tinyerp.com-20130131092440-gxhz5y5rxkfuy9k3 --- addons/hr_timesheet_sheet/hr_timesheet_sheet.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py index c473670b014..d9b76dcfb89 100644 --- a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py +++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py @@ -93,8 +93,7 @@ class hr_timesheet_sheet(osv.osv): 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: - wf_service = netsvc.LocalService("workflow") - wf_service.trg_validate(uid, 'hr_timesheet_sheet.sheet', sheet.id, 'confirm', cr) + self.signal_confirm(cr, uid, [sheet.id]) else: raise osv.except_osv(_('Warning!'), _('Please verify that the total difference of the sheet is lower than %.2f.') %(di,)) return True @@ -192,9 +191,8 @@ class hr_timesheet_sheet(osv.osv): def action_set_to_draft(self, cr, uid, ids, *args): self.write(cr, uid, ids, {'state': 'draft'}) - wf_service = netsvc.LocalService('workflow') for id in ids: - wf_service.trg_create(uid, self._name, id, cr) + self.create_workflow(cr, uid, [id]) return True def name_get(self, cr, uid, ids, context=None):