[IMP] base_calendar,crm: remove Edit All and Exclude range button

bzr revid: sbh@tinyerp.com-20101215092601-y7o3ccuoo0961db0
This commit is contained in:
Sbh (OpenERP) 2010-12-15 14:56:01 +05:30
parent 452ff6326c
commit 1415c477fc
4 changed files with 64 additions and 97 deletions

View File

@ -1176,7 +1176,9 @@ e.g.: Every other month on the last Sunday of the month for 10 occurrences:\
'event_id', 'attendee_id', 'Attendees'),
'allday': fields.boolean('All Day', states={'done': [('readonly', True)]}),
'active': fields.boolean('Active', help="If the active field is set to \
true, it will allow you to hide the event alarm information without removing it.")
true, it will allow you to hide the event alarm information without removing it."),
'recurrency': fields.boolean('Recurrency', help="Recurrent Meeting"),
'edit_all': fields.boolean('Edit All', help="Edit all Occurrences of recurrent Meeting."),
}
def default_organizer(self, cr, uid, context=None):
user_pool = self.pool.get('res.users')
@ -1198,45 +1200,15 @@ true, it will allow you to hide the event alarm information without removing it.
'organizer': default_organizer,
}
def open_event(self, cr, uid, ids, context=None):
"""
Open Event From for Editing
@param cr: the current row, from the database cursor,
@param uid: the current users ID for security checks,
@param ids: List of events IDs
@param context: A standard dictionary for contextual values
@return: Dictionary value which open Crm Meeting form.
"""
if context is None:
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, 'base_calendar', 'event_form_view')
id3 = data_obj._get_id(cr, uid, 'base_calendar', 'event_tree_view')
id4 = data_obj._get_id(cr, uid, 'base_calendar', 'event_calendar_view')
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': _('Event'),
'view_type': 'form',
'view_mode': 'form,tree',
'res_model': 'calendar.event',
'view_id': False,
'views': [(id2, 'form'), (id3, 'tree'), (id4, 'calendar')],
'type': 'ir.actions.act_window',
'res_id': base_calendar_id2real_id(id),
'nodestroy': True
}
return value
if edit_all and rrule_type:
for id in ids:
base_calendar.base_calendar_id2real_id(id)
return value
def modify_all(self, cr, uid, event_ids, defaults, context=None, *args):
"""

View File

@ -241,62 +241,9 @@
<field name="alarm_id" string="Reminder"
widget="selection" />
<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 Events"
attrs="{'invisible':[('rrule_type','in', ('none', False))]}"
name="open_event" 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' : 'calendar.event'}"
attrs="{'invisible':[('rrule_type','in', ('none', False))]}"/>
</group>
</group>
<group col="4" colspan="4" name="rrule" attrs="{'invisible': [('rrule_type','!=','custom')]}">
<separator string="Select data for Custom Rule" colspan="8"/>
<group col="8" colspan="4">
<field name="interval" />
<field name="freq" />
<field name="count" />
<field name="end_date" />
</group>
<group col="14" colspan="4" name="Select weekdays"
attrs="{'invisible' : [('freq','!=','weekly')]}">
<field name="mo" colspan="1" />
<field name="tu" colspan="1" />
<field name="we" colspan="1" />
<field name="th" colspan="1" />
<field name="fr" colspan="1" />
<field name="sa" colspan="1" />
<field name="su" colspan="1" />
<newline />
</group>
<group col="10" colspan="4"
attrs="{'invisible' : [('freq','!=','monthly'), ('freq','!=','yearly')]}">
<group col="2" colspan="1">
<field name="select1" />
</group>
<group col="2" colspan="1"
attrs="{'invisible' : [('select1','=','day')]}">
<field name="day"
attrs="{'required' : [('select1','=','date')]}" />
</group>
<group col="3" colspan="1"
attrs="{'invisible' : [('select1','=','date')]}">
<field name="byday" string="The"
attrs="{'required' : [('select1','=','day')]}" />
<field name="week_list" nolabel="1"
attrs="{'required' : [('select1','=','day')]}" />
</group>
<group col="1" colspan="1"
attrs="{'invisible' : [('freq','!=','yearly')]}">
<field name="month_list" string="of"
colspan="1"
attrs="{'required' : [('freq','=','yearly')]}" />
</group>
<field name="recurrency"/>
<field name="edit_all" attrs="{'invisible':[('recurrency','=', False)]}"
on_change="onchange_edit_all(rrule_type,edit_all)"/>
</group>
</group>
<notebook colspan="4">
@ -397,6 +344,56 @@
</form>
</field>
</page>
<page string="Recurrency Option" attrs="{'invisible':[('recurrency','=',False)]}">
<group col="4" colspan="4" name="rrule">
<group col="2" colspan="2">
<field name="rrule_type" string="Recurrency"
attrs="{'readonly':[('recurrent_uid','!=',False)]}" colspan="2"/>
<label string="" colspan="2"/>
</group>
<separator string="Recurrency Rule" colspan="8"/>
<group col="6" colspan="4">
<field name="interval" string="Repeat Times" attrs="{'invisible': [('end_date','!=',False)]}"/>
<field name="end_date" attrs="{'invisible': [('interval','!=',False)]}"/>
</group>
<group col="14" colspan="4" name="Select weekdays"
attrs="{'invisible' : [('rrule_type','!=','weekly')]}">
<field name="mo" colspan="1" />
<field name="tu" colspan="1" />
<field name="we" colspan="1" />
<field name="th" colspan="1" />
<newline/>
<field name="fr" colspan="1" />
<field name="sa" colspan="1" />
<field name="su" colspan="1" />
<newline />
</group>
<group col="10" colspan="4"
attrs="{'invisible' : [('rrule_type','!=','monthly'), ('rrule_type','!=','yearly')]}">
<group col="2" colspan="1">
<field name="select1" />
</group>
<group col="2" colspan="1"
attrs="{'invisible' : [('select1','=','day')]}">
<field name="day"
attrs="{'required' : [('select1','=','date')]}" />
</group>
<group col="3" colspan="1"
attrs="{'invisible' : [('select1','=','date')]}">
<field name="byday" string="The"
attrs="{'required' : [('select1','=','day')]}" />
<field name="week_list" nolabel="1"
attrs="{'required' : [('select1','=','day')]}" />
</group>
<group col="1" colspan="1"
attrs="{'invisible' : [('rrule_type','!=','yearly')]}">
<field name="month_list" string="of"
colspan="1"
attrs="{'required' : [('rrule_type','=','yearly')]}" />
</group>
</group>
</group>
</page>
</notebook>
</form>
</field>

View File

@ -73,8 +73,6 @@ class crm_meeting(crm_case, osv.osv):
('cancel', 'Cancelled'),
('done', 'Done')], 'State', \
size=16, readonly=True),
'recurrency': fields.boolean('Recurrency', help="Recurrent Meeting"),
'edit_all': fields.boolean('Edit All', help="Edit all Occurrences of recurrent Meeting."),
}
def onchange_edit_all(self, cr, uid, ids, rrule_type,edit_all, context=None):
if not context:

View File

@ -168,12 +168,12 @@
<page string="Recurrency Option" attrs="{'invisible':[('recurrency','=',False)]}">
<group col="4" colspan="4" name="rrule">
<group col="2" colspan="2">
<field name="rrule_type" string="Recurrency" colspan="2"/>
<field name="rrule_type" string="Recurrency"
attrs="{'readonly':[('recurrent_uid','!=',False)]}" colspan="2"/>
<label string="" colspan="2"/>
</group>
<separator string="Recurrency Rule" colspan="8"/>
<group col="6" colspan="4">
<!--<field name="freq" />-->
<field name="interval" string="Repeat Times" attrs="{'invisible': [('end_date','!=',False)]}"/>
<field name="end_date" attrs="{'invisible': [('interval','!=',False)]}"/>
</group>