summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBharat (OpenERP) <bde@tinyerp.com>2011-09-07 18:10:54 +0530
committerBharat (OpenERP) <bde@tinyerp.com>2011-09-07 18:10:54 +0530
commite5b15924cd4ea9f34186aa174361eaa83f7dfd9c (patch)
tree36cdd60495c62fdefdb28d2a4cd321a8070d7ef6
parente4ba5e6c5afb07d68136a332bbb6e6ebcd86eeb0 (diff)
[IMP] improved the function name and made code compatible according to osv.osv_memory for wizard_history_event
bzr revid: bde@tinyerp.com-20110907124054-jochp9iishedo2ig
-rw-r--r--addons/crm/wizard/crm_phonecall_to_meeting.py2
-rw-r--r--addons/crm/wizard/wizard_history_event.py20
2 files changed, 11 insertions, 11 deletions
diff --git a/addons/crm/wizard/crm_phonecall_to_meeting.py b/addons/crm/wizard/crm_phonecall_to_meeting.py
index fa1b42b96ae..9e902142c94 100644
--- a/addons/crm/wizard/crm_phonecall_to_meeting.py
+++ b/addons/crm/wizard/crm_phonecall_to_meeting.py
@@ -21,8 +21,6 @@
from osv import osv
from tools.translate import _
-import wizard
-import pooler
class crm_phonecall2meeting(osv.osv_memory):
""" Phonecall to Meeting """
diff --git a/addons/crm/wizard/wizard_history_event.py b/addons/crm/wizard/wizard_history_event.py
index fbc1682df87..14563529e28 100644
--- a/addons/crm/wizard/wizard_history_event.py
+++ b/addons/crm/wizard/wizard_history_event.py
@@ -20,26 +20,26 @@
#
##############################################################################
-import wizard
-import pooler
from osv import osv, fields
class case_history_event(osv.osv_memory):
_name = 'case.history.event'
+ _description = "Case History Event"
- def default_get(self, cr, uid, data, context=None):
- pool = pooler.get_pool(cr.dbname)
- data_obj = pool.get('ir.model.data')
+ def open_history_event(self, cr, uid, ids, context=None):
+ model = context.get('active_model', False)
+ act_id = context.get('active_id', False)
+ data_obj = self.pool.get('ir.model.data')
result = data_obj._get_id(cr, uid, 'crm', 'view_crm_case_filter')
id = data_obj.read(cr, uid, result, ['res_id'])
id2 = data_obj._get_id(cr, uid, 'crm', 'crm_case_calendar_section-view')
if id2:
id2 = data_obj.browse(cr, uid, id2, context=context).res_id
res = ''
- if data.get('model',False) and data.get('ids',False):
- model_obj = pooler.get_pool(cr.dbname).get(data['model'])
- res = model_obj.browse(cr, uid, data['ids'], context=context)
+ if model and ids:
+ model_obj = self.pool.get(model)
+ res = model_obj.browse(cr, uid, ids, context=context)
if len(res):
res = res[0].name
return {
@@ -50,8 +50,10 @@ class case_history_event(osv.osv_memory):
'views': [(id2,'calendar'),(False,'form'),(False,'tree'),(False,'graph')],
'res_model': 'crm.case',
'type': 'ir.actions.act_window',
- 'domain': data.get('id',False) and "[('case_id','=',%d)]" % (data['id']) or "[]",
+ 'domain': act_id and "[('case_id','=',%d)]" % act_id or "[]",
'search_view_id': id['res_id']
}
case_history_event()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: