From 3f93055036a30b4f1eebd31b8448c8649dd62e49 Mon Sep 17 00:00:00 2001 From: "Sbh (OpenERP)" Date: Thu, 9 Dec 2010 12:49:04 +0530 Subject: [PATCH] [FIX] crm: Fix the troubles with recurency in calendar,[IMP] remove Exclude range button and add the boolean field for edit all lp bug: https://launchpad.net/bugs/684791 fixed bzr revid: sbh@tinyerp.com-20101209071904-2jt38mur25otkhgn --- addons/crm/crm_meeting.py | 52 +++++++-------------------------- addons/crm/crm_meeting_view.xml | 12 ++------ 2 files changed, 13 insertions(+), 51 deletions(-) diff --git a/addons/crm/crm_meeting.py b/addons/crm/crm_meeting.py index 13784741892..cd6a147f787 100644 --- a/addons/crm/crm_meeting.py +++ b/addons/crm/crm_meeting.py @@ -72,55 +72,25 @@ class crm_meeting(crm_case, osv.osv): ('draft', 'Unconfirmed'), ('cancel', 'Cancelled'), ('done', 'Done')], 'State', \ - size=16, readonly=True) + size=16, readonly=True), + 'edit_all': fields.boolean('Edit All', help="Edit all Occurrences of recurrent Meeting."), } - - _defaults = { - 'state': lambda *a: 'draft', - 'active': lambda *a: 1, - 'user_id': lambda self, cr, uid, ctx: uid, - } - - def open_meeting(self, cr, uid, ids, context=None): - """ - Open Crm Meeting Form for Crm Meeting. - @param cr: the current row, from the database cursor, - @param uid: the current user’s ID for security checks, - @param ids: List of crm meeting’s IDs - @param context: A standard dictionary for contextual values - @return: Dictionary value which open Crm Meeting form. - """ - + def onchange_edit_all(self, cr, uid, ids, rrule_type,edit_all, context=None): if not context: context = {} data_obj = self.pool.get('ir.model.data') value = {} - - id2 = data_obj._get_id(cr, uid, 'crm', 'crm_case_form_view_meet') - id3 = data_obj._get_id(cr, uid, 'crm', 'crm_case_tree_view_meet') - id4 = data_obj._get_id(cr, uid, 'crm', 'crm_case_calendar_view_meet') - if id2: - id2 = data_obj.browse(cr, uid, id2, context=context).res_id - if id3: - id3 = data_obj.browse(cr, uid, id3, context=context).res_id - if id4: - id4 = data_obj.browse(cr, uid, id4, context=context).res_id - for id in ids: - value = { - 'name': _('Meeting'), - 'view_type': 'form', - 'view_mode': 'form,tree', - 'res_model': 'crm.meeting', - 'view_id': False, - 'views': [(id2, 'form'), (id3, 'tree'), (id4, 'calendar')], - 'type': 'ir.actions.act_window', - 'res_id': base_calendar.base_calendar_id2real_id(id), - 'nodestroy': True - } - + if edit_all and rrule_type: + for id in ids: + base_calendar.base_calendar_id2real_id(id) return value + _defaults = { + 'state': lambda *a: 'draft', + 'active': lambda *a: 1, + 'user_id': lambda self, cr, uid, ctx: uid, + } def case_open(self, cr, uid, ids, *args): """Confirms meeting diff --git a/addons/crm/crm_meeting_view.xml b/addons/crm/crm_meeting_view.xml index b44b146375a..e276c23fe83 100644 --- a/addons/crm/crm_meeting_view.xml +++ b/addons/crm/crm_meeting_view.xml @@ -46,16 +46,8 @@ -