Merge lp:~openerp-dev/openobject-addons/trunk-crm_wizard_convert_osv_memory-bde into lp:openobject-addons

Proposed by Bharat Devnani (Open ERP)
Status: Merged
Merged at revision: 5415
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-crm_wizard_convert_osv_memory-bde
Merge into: lp:openobject-addons
Diff against target: 175 lines (+53/-71)
2 files modified
crm/wizard/crm_phonecall_to_meeting.py (+13/-67)
crm/wizard/wizard_history_event.py (+40/-4)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-crm_wizard_convert_osv_memory-bde
Reviewer Review Type Date Requested Status
Mustufa Rangwala (Open ERP) (community) Approve
Bharat Devnani (Open ERP) (community) Needs Resubmitting
Vo Minh Thu Pending
Review via email: mp+73335@code.launchpad.net

Description of the change

Hello Sir,

I have converted wizards from wizard.interface to osv.osv_memory for crm module.

Thanks & Regards,
Devnani Bharat R.

To post a comment you must log in.
Revision history for this message
Mustufa Rangwala (Open ERP) (mra-tinyerp) wrote :

'crm/wizard/wizard_history_event.py' => improve the wizard as you have change the name of method from _open_history_event to default_get.

And do not forget to mention in comment which wizards you have converted to osv memory.

Thanks,
Mustufa

review: Needs Fixing
Revision history for this message
Bharat Devnani (Open ERP) (bde-openerp) wrote :

Hello Sir,

I have converted and improved the wizard_history_event as per your suggestions. As crm_phonecall_to_meeting wizard was already converted to osv.osv_memory so i have just removed the previous version (wizard.interface) of the same.

Thanks & Regards,
Devnani Bharat R.

review: Needs Resubmitting
Revision history for this message
Mustufa Rangwala (Open ERP) (mra-tinyerp) wrote :

Open history event wizard converted to osv memory (not used anywhere).

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'crm/wizard/crm_phonecall_to_meeting.py'
2--- crm/wizard/crm_phonecall_to_meeting.py 2011-01-14 00:11:01 +0000
3+++ crm/wizard/crm_phonecall_to_meeting.py 2011-09-15 11:38:33 +0000
4@@ -21,60 +21,6 @@
5
6 from osv import osv
7 from tools.translate import _
8-import wizard
9-import pooler
10-
11-#===============================================================================
12-# Put original wizard because of action in init
13-# Remove it after solution foraction in init
14-#===============================================================================
15-
16-class phonecall2meeting(wizard.interface):
17-
18- def _makeMeeting(self, cr, uid, data, context=None):
19- pool = pooler.get_pool(cr.dbname)
20- phonecall_case_obj = pool.get('crm.phonecall')
21- data_obj = pool.get('ir.model.data')
22- result = data_obj._get_id(cr, uid, 'crm', 'view_crm_case_meetings_filter')
23- id = data_obj.read(cr, uid, result, ['res_id'])
24- id1 = data_obj._get_id(cr, uid, 'crm', 'crm_case_calendar_view_meet')
25- id2 = data_obj._get_id(cr, uid, 'crm', 'crm_case_form_view_meet')
26- id3 = data_obj._get_id(cr, uid, 'crm', 'crm_case_tree_view_meet')
27- if id1:
28- id1 = data_obj.browse(cr, uid, id1, context=context).res_id
29- if id2:
30- id2 = data_obj.browse(cr, uid, id2, context=context).res_id
31- if id3:
32- id3 = data_obj.browse(cr, uid, id3, context=context).res_id
33- phonecall = phonecall_case_obj.browse(cr, uid, data['id'], context=context)
34- partner_id = phonecall.partner_id and phonecall.partner_id.id or False
35- name = phonecall.name
36- email = phonecall.email_from
37- section_id = phonecall.section_id and phonecall.section_id.id or False
38- return {
39- 'name': _('Meetings'),
40- 'domain' : "[('user_id','=',%s)]"%(uid),
41- 'context': {'default_partner_id': partner_id, 'default_section_id': section_id, 'default_email_from': email, 'default_state':'open', 'default_name':name},
42- 'view_type': 'form',
43- 'view_mode': 'calendar,form,tree',
44- 'res_model': 'crm.meeting',
45- 'view_id': False,
46- 'views': [(id1,'calendar'),(id2,'form'),(id3,'tree')],
47- 'type': 'ir.actions.act_window',
48- 'search_view_id': id['res_id']
49- }
50-
51- states = {
52- 'init': {
53- 'actions': [],
54- 'result': {'type': 'action', 'action': _makeMeeting, 'state': 'order'}
55- },
56- 'order': {
57- 'actions': [],
58- 'result': {'type': 'state', 'state': 'end'}
59- }
60- }
61-phonecall2meeting('crm.phonecall.meeting_set')
62
63 class crm_phonecall2meeting(osv.osv_memory):
64 """ Phonecall to Meeting """
65@@ -109,7 +55,7 @@
66 record_id = context and context.get('active_id', False) or False
67
68 if record_id:
69- phonecall_obj = self.pool.get('crm.phonecall')
70+ phonecall_obj = self.pool.get('crm.phonecall')
71 data_obj = self.pool.get('ir.model.data')
72
73 # Get meeting views
74@@ -127,22 +73,22 @@
75
76 phonecall = phonecall_obj.browse(cr, uid, record_id, context=context)
77 context = {
78- 'default_phonecall_id': phonecall.id,
79- 'default_partner_id': phonecall.partner_id and phonecall.partner_id.id or False,
80- 'default_email': phonecall.email_from ,
81+ 'default_phonecall_id': phonecall.id,
82+ 'default_partner_id': phonecall.partner_id and phonecall.partner_id.id or False,
83+ 'default_email': phonecall.email_from ,
84 'default_name': phonecall.name
85 }
86
87 value = {
88- 'name': _('Meetings'),
89- 'domain' : "[('user_id','=',%s)]" % (uid),
90- 'context': context,
91- 'view_type': 'form',
92- 'view_mode': 'calendar,form,tree',
93- 'res_model': 'crm.meeting',
94- 'view_id': False,
95- 'views': [(id1, 'calendar'), (id2, 'form'), (id3, 'tree')],
96- 'type': 'ir.actions.act_window',
97+ 'name': _('Meetings'),
98+ 'domain' : "[('user_id','=',%s)]" % (uid),
99+ 'context': context,
100+ 'view_type': 'form',
101+ 'view_mode': 'calendar,form,tree',
102+ 'res_model': 'crm.meeting',
103+ 'view_id': False,
104+ 'views': [(id1, 'calendar'), (id2, 'form'), (id3, 'tree')],
105+ 'type': 'ir.actions.act_window',
106 'search_view_id': res['res_id']
107 }
108
109
110=== modified file 'crm/wizard/wizard_history_event.py'
111--- crm/wizard/wizard_history_event.py 2011-08-09 23:44:28 +0000
112+++ crm/wizard/wizard_history_event.py 2011-09-15 11:38:33 +0000
113@@ -1,7 +1,7 @@
114 # -*- coding: utf-8 -*-
115 ##############################################################################
116 #
117-# OpenERP, Open Source Management Solution
118+# OpenERP, Open Source Management Solution
119 # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved
120 # $Id$
121 #
122@@ -20,6 +20,40 @@
123 #
124 ##############################################################################
125
126+<<<<<<< TREE
127+from osv import osv, fields
128+
129+class case_history_event(osv.osv_memory):
130+
131+ _name = 'case.history.event'
132+ _description = "Case History Event"
133+
134+ def open_history_event(self, cr, uid, ids, context=None):
135+ model = context.get('active_model', False)
136+ act_id = context.get('active_id', False)
137+ data_obj = self.pool.get('ir.model.data')
138+ result = data_obj._get_id(cr, uid, 'crm', 'view_crm_case_filter')
139+ id = data_obj.read(cr, uid, result, ['res_id'])
140+ id2 = data_obj._get_id(cr, uid, 'crm', 'crm_case_calendar_section-view')
141+ if id2:
142+ id2 = data_obj.browse(cr, uid, id2, context=context).res_id
143+ res = ''
144+ if model and ids:
145+ model_obj = self.pool.get(model)
146+ res = model_obj.browse(cr, uid, ids, context=context)
147+ if len(res):
148+ res = res[0].name
149+ return {
150+ 'name': 'History : ' + res,
151+ 'view_type': 'form',
152+ "view_mode": 'calendar, tree, form',
153+ 'view_id' : False,
154+ 'views': [(id2,'calendar'),(False,'form'),(False,'tree'),(False,'graph')],
155+ 'res_model': 'crm.case',
156+ 'type': 'ir.actions.act_window',
157+ 'domain': act_id and "[('case_id','=',%d)]" % act_id or "[]",
158+ 'search_view_id': id['res_id']
159+=======
160 import wizard
161 import pooler
162
163@@ -54,7 +88,9 @@
164 'init': {
165 'actions': [],
166 'result': {'type': 'action', 'action': _open_history_event, 'state':'end'}
167+>>>>>>> MERGE-SOURCE
168 }
169- }
170-
171-case_history_event('crm.case.history.events')
172+
173+case_history_event()
174+
175+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

Subscribers

People subscribed via source and target branches

to all changes: