[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
This commit is contained in:
Sbh (OpenERP) 2010-12-09 12:49:04 +05:30
parent f022e07378
commit 3f93055036
2 changed files with 13 additions and 51 deletions

View File

@ -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 users ID for security checks,
@param ids: List of crm meetings 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

View File

@ -46,16 +46,8 @@
<group colspan="2" col="4" >
<field name="rrule_type" string="Recurrency"
colspan="1" attrs="{'readonly':[('recurrent_uid','!=',False)]}"/>
<button string="Edit All"
help="Edit all Ourrences of recurrent Meeting"
attrs="{'invisible':[('rrule_type','in', ('none', False))]}"
name="open_meeting" icon="gtk-edit"
type="object" />
<button string="Exclude range" groups="base.group_extended"
help="Add Exception Rule"
name="%(base_calendar.action_base_calendar_set_exrule)d" icon="gtk-zoom-out" type="action"
context="{'model' : 'crm.meeting'}"
attrs="{'invisible':[('rrule_type','in', ('none', False))]}"/>
<field name="edit_all" attrs="{'invisible':[('rrule_type','in', ('none', False))]}"
on_change="onchange_edit_all(rrule_type,edit_all)"/>
</group>
</group>
<group col="4" colspan="4" name="rrule" attrs="{'invisible': [('rrule_type','!=','custom')]}">