[IMP] crm: Removed 'Edit All' and 'Exclude range' buttons without changing the functi...
authorSBH,UCO <>
Tue, 14 Dec 2010 12:09:54 +0000 (17:39 +0530)
committeruco (OpenERP) <uco@tinyerp.com>
Tue, 14 Dec 2010 12:09:54 +0000 (17:39 +0530)
bzr revid: uco@tinyerp.com-20101214120954-fk7hv5ct4dqxbopz

addons/base_calendar/base_calendar.py
addons/crm/board_crm_view.xml
addons/crm/crm_meeting.py
addons/crm/crm_meeting_view.xml
addons/crm/test/test_crm_meeting.yml

index c567105..300cec3 100644 (file)
@@ -1151,9 +1151,7 @@ e.g.: Every other month on the last Sunday of the month for 10 occurrences:\
                                 ('daily', 'Days'), \
                                 ('weekly', 'Weeks'), \
                                 ('monthly', 'Months'), \
-                                ('yearly', 'Years'), \
-                                ('secondly', 'Seconds'), \
-                                ('minutely', 'Minutes') ], 'Frequency'),
+                                ('yearly', 'Years')], 'Frequency'),
         'interval': fields.integer('Interval', help="Repeat every x"),
         'count': fields.integer('Count', help="Repeat max that times"),
         'mo': fields.boolean('Mon'),
index 80e7fbf..b834270 100644 (file)
             <field name="usage">menu</field>
             <field name="view_id" ref="board_crm_form"/>
         </record>
-         <menuitem id="board.menu_dasboard" name="Dashboard" sequence="0" parent="base.next_id_64"/>
+        <menuitem id="board.menu_dasboard" name="Dashboard" sequence="0" parent="base.next_id_64"/>
         <menuitem
             name="Sales Dashboard" parent="board.menu_dasboard"
             action="open_board_crm"
index 1378474..735cfc3 100644 (file)
@@ -72,55 +72,28 @@ class crm_meeting(crm_case, osv.osv):
                                     ('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
index 2de562a..f78ba91 100644 (file)
                     <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>
index 6dcf56c..eaa58fc 100644 (file)
@@ -62,7 +62,7 @@
   Now If I want to edit meetings information for all occurrence I click on "Edit All" button.
 -
   !python {model: crm.meeting}: |
-    self.open_meeting(cr, uid, [ref('crm_meeting_regardingpresentation0')])
+     self.write(cr, uid, [ref('crm_meeting_regardingpresentation0')], {'edit_all':'True'},context)
 - |   
   I can see that new meeting form is opened with same value
   I change some data for meeting and save it