From c5ca4b925f5c08651f090a3e76dac07d1e3ff711 Mon Sep 17 00:00:00 2001 From: "Jay Vora (OpenERP)" Date: Wed, 2 Mar 2011 15:57:50 +0530 Subject: [PATCH] [FIX] Hr_Holidays : Refusal of a leave was broken, corrected by changing the datatype of case_id into hr.holidays model ( Ref : Revision 4935 mra@mra-laptop-20110201124038-fwehl3uq7qo3tp6v from branch trunk-dev-addons3 ) lp bug: https://launchpad.net/bugs/709130 fixed bzr revid: jvo@tinyerp.com-20110302102750-au1j2gyasyhlqj3k --- addons/hr_holidays/hr_holidays.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/hr_holidays/hr_holidays.py b/addons/hr_holidays/hr_holidays.py index 3e7a4a1b3a2..9d6328af1eb 100644 --- a/addons/hr_holidays/hr_holidays.py +++ b/addons/hr_holidays/hr_holidays.py @@ -126,7 +126,7 @@ class hr_holidays(osv.osv): 'notes': fields.text('Reasons',readonly=True, states={'draft':[('readonly',False)]}), 'number_of_days_temp': fields.float('Number of Days', readonly=True, states={'draft':[('readonly',False)]}), 'number_of_days': fields.function(_compute_number_of_days, method=True, string='Number of Days', store=True), - 'case_id': fields.char('Meeting', size=64), + 'case_id': fields.many2one('crm.meeting', 'Meeting'), 'type': fields.selection([('remove','Leave Request'),('add','Allocation Request')], 'Request Type', required=True, readonly=True, states={'draft':[('readonly',False)]}, help="Choose 'Leave Request' if someone wants to take an off-day. \nChoose 'Allocation Request' if you want to increase the number of leaves available for someone"), 'parent_id': fields.many2one('hr.holidays', 'Parent'), 'linked_request_ids': fields.one2many('hr.holidays', 'parent_id', 'Linked Requests',), @@ -290,7 +290,7 @@ class hr_holidays(osv.osv): for record in self.browse(cr, uid, ids): # Delete the meeting if record.case_id: - obj_crm_meeting.unlink(cr, uid, [record.case_id]) + obj_crm_meeting.unlink(cr, uid, [record.case_id.id]) # If a category that created several holidays, cancel all related wf_service = netsvc.LocalService("workflow")