From 1ce50a133b145d2773c90db8b8267a50d9b68524 Mon Sep 17 00:00:00 2001 From: "Mayur Maheshwari (OpenERP)" Date: Tue, 26 Feb 2013 12:22:39 +0530 Subject: [PATCH] [FIX]base_calender:improve method and doc_string for fix issue of duplication record bzr revid: mma@tinyerp.com-20130226065239-w8xxdv7nlm80q5my --- addons/base_calendar/base_calendar.py | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/addons/base_calendar/base_calendar.py b/addons/base_calendar/base_calendar.py index ab0d8d324b4..5d602330539 100644 --- a/addons/base_calendar/base_calendar.py +++ b/addons/base_calendar/base_calendar.py @@ -577,8 +577,7 @@ property or property parameter."), def do_accept(self, cr, uid, ids, context=None, *args): """ - Update state of invitation as Accepted and if the invited user is other - then event user it will make a copy of this event for invited user. + Marks event invitation as Accepted. @param cr: the current row, from the database cursor @param uid: the current user's ID for security checks @param ids: list of calendar attendee's IDs @@ -587,16 +586,7 @@ property or property parameter."), """ if context is None: context = {} - - for vals in self.browse(cr, uid, ids, context=context): - if vals.ref and vals.ref.user_id: - mod_obj = self.pool.get(vals.ref._name) - res=mod_obj.read(cr,uid,[vals.ref.id],['duration','class'],context) - defaults = {'user_id': vals.user_id.id, 'organizer_id': vals.ref.user_id.id,'duration':res[0]['duration'],'class':res[0]['class']} - mod_obj.copy(cr, uid, vals.ref.id, default=defaults, context=context) - self.write(cr, uid, vals.id, {'state': 'accepted'}, context) - - return True + return self.write(cr, uid, ids, {'state': 'accepted'}, context) def do_decline(self, cr, uid, ids, context=None, *args): """