('draft', 'Unconfirmed'),
('cancel', 'Cancelled'),
('done', 'Done')], 'State', \
- size=16, readonly=True)
+ size=16, readonly=True),
+ 'recurrency': fields.boolean('Recurrency', help="Recurrent Meeting"),
+ '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
<field name="location" />
<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 Occurrences 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))]}"/>
- </group>
- </group>
- <group col="4" colspan="4" name="rrule" attrs="{'invisible': [('rrule_type','!=','custom')]}">
- <separator string="Custom Recurrency 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>
+ <group colspan="2" col="4">
+ <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">
</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="freq" />
+ <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' : [('freq','!=','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' : [('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>
+ </group>
+ </group>
+ </page>
</notebook>
</form>
</field>