[IMP]: crm: open crm Meeting form in edit all button using function in place of calendar edit all wizard.
bzr revid: atp@tinyerp.co.in-20100326120908-47h3pyawkp2bp5fx
This commit is contained in:
@@ -23,6 +23,8 @@ from osv import fields, osv
|
||||
import crm
|
||||
from datetime import datetime, timedelta
|
||||
from datetime import datetime, timedelta
|
||||
from tools.translate import _
|
||||
from base_calendar import base_calendar
|
||||
|
||||
class crm_opportunity(osv.osv):
|
||||
_name = 'crm.opportunity'
|
||||
@@ -65,6 +67,46 @@ class crm_meeting(osv.osv):
|
||||
_defaults = {
|
||||
'state': lambda *a: 'draft',
|
||||
}
|
||||
|
||||
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.
|
||||
"""
|
||||
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
|
||||
}
|
||||
|
||||
return value
|
||||
|
||||
crm_meeting()
|
||||
|
||||
|
||||
@@ -46,11 +46,9 @@
|
||||
<button string="Edit All"
|
||||
help="Edit all Ourrences of recurrent Meeting"
|
||||
attrs="{'invisible':[('rrule_type','in', ('none', False))]}"
|
||||
name="%(base_calendar.action_calendar_event_edit_all)d"
|
||||
icon="gtk-edit" type="action"
|
||||
context="{'model' : 'crm.meeting', 'date': date, 'date_deadline': date_deadline}" />
|
||||
name="open_meeting" icon="gtk-edit"
|
||||
type="object" />
|
||||
</group>
|
||||
|
||||
</group>
|
||||
<group col="4" colspan="4" name="rrule" attrs="{'invisible': [('rrule_type','!=','custom')]}">
|
||||
<separator string="Select data for Custom Rule" colspan="8"/>
|
||||
|
||||
Reference in New Issue
Block a user