[FIX]base_calender:improve method and doc_string for fix issue of duplication record

bzr revid: mma@tinyerp.com-20130226065239-w8xxdv7nlm80q5my
This commit is contained in:
Mayur Maheshwari (OpenERP) 2013-02-26 12:22:39 +05:30
parent 4a34c70ca8
commit 1ce50a133b
1 changed files with 2 additions and 12 deletions

View File

@ -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):
"""