Merge lp:~openerp-dev/openobject-addons/trunk-bug-862227-dbr into lp:openobject-addons

Proposed by DBR (OpenERP)
Status: Rejected
Rejected by: Mustufa Rangwala (Open ERP)
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-862227-dbr
Merge into: lp:openobject-addons
Diff against target: 553 lines (+210/-177)
10 files modified
base_module_doc_rst/base_module_doc_rst_wizard.xml (+43/-14)
base_module_doc_rst/wizard/__init__.py (+1/-1)
base_module_doc_rst/wizard/generate_relation_graph.py (+16/-24)
base_module_doc_rst/wizard/tech_guide_rst.py (+18/-41)
base_module_quality/base_module_quality_wizard.xml (+43/-8)
base_module_quality/wizard/module_quality_check.py (+7/-13)
base_module_quality/wizard/quality_save_report.py (+28/-33)
google_map/google_map_wizard.xml (+22/-6)
google_map/wizard/google_map_launch.py (+30/-35)
share/res_users.py (+2/-2)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-862227-dbr
Reviewer Review Type Date Requested Status
Raphael Collet (OpenERP) (community) Needs Fixing
Stefan Rijnhart (Opener) (community) Approve
Bhumika Shrimali Pending
Review via email: mp+78077@code.launchpad.net

Description of the change

Hello Ma'am,

Fixes : wizard.interface to osv.osv_memory wizard

Improved following modules:
  base_module_doc_rst
  base_module_quality
  google_map

Rename:
base_module_doc_rst/wizard/wizard_tech_guide_rst.py => base_module_doc_rst/wizard/tech_guide_rst.py

So,Kindly review it.

Thanks.

To post a comment you must log in.
Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

Hi,

Two points here:

1 the associated bug explicitely mentions base_module_record. This branch migrates a number of wizards to osv_memory, but not in this module.

The full list of modules which use the wizard.interface and which this branch does not fix is:

account_asset
base_module_record
base_report_creator
crm
crm_profiling

2 osv.osv_memory is deprecated in OpenERP 6.1 [1], is it then not better to use TransientModel instead?

Cheers,
Stefan.

[1] http://bazaar.launchpad.net/~openerp/openobject-server/trunk/view/3717/openerp/osv/osv.py#L201

review: Needs Fixing
Revision history for this message
Mustufa Rangwala (Open ERP) (mra-tinyerp) wrote :
Revision history for this message
Bhumika Shrimali (sbh-openerp) wrote :

Thanks Mustufa sir for giving the detail .
DBR can you check for crm_profiling module one Profiling wizard is still not converted.

Revision history for this message
Bhumika Shrimali (sbh-openerp) wrote :
Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

OK, thanks for the information.

Stefan.

review: Approve
Revision history for this message
Raphael Collet (OpenERP) (rco-openerp) wrote :

1. google_map has already been adapted, see by https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-google_map_wizard-bde/+merge/73215. Please cancel your changes about google_map.

2. The modifications in module share has nothing to do in this merge proposal. Please revert, and make a specific proposal for this one, if needed.

3. base_module_quality is broken. Please check model names, and fix them:

[2011-11-28 14:51:42,179][trunk_20111128] INFO:init.load:module base_module_quality: loading wizard/module_quality_check_view.xml
[2011-11-28 14:51:42,211][trunk_20111128] ERROR:tools.convert.xml_import:Parse error in /home/openerp/openerp/addons/trunk/base_module_quality/wizard/module_quality_check_view.xml:29:
<act_window name="Quality Check" id="act_base_module_quality" res_model="quality.check" src_model="ir.module.module" view_mode="form" target="new" key2="client_action_multi"/>
Traceback (most recent call last):
  File "/home/openerp/openerp/server/trunk/openerp/tools/convert.py", line 889, in parse
    self._tags[rec.tag](self.cr, rec, n)
  File "/home/openerp/openerp/server/trunk/openerp/tools/convert.py", line 523, in _tag_act_window
    id = self.pool.get('ir.model.data')._update(cr, self.uid, 'ir.actions.act_window', self.module, res, xml_id, noupdate=self.isnoupdate(data_node), mode=self.mode)
  File "/home/openerp/openerp/server/trunk/openerp/addons/base/ir/ir_model.py", line 692, in _update
    model_obj.write(cr, uid, [res_id], values, context=context)
  File "/home/openerp/openerp/server/trunk/openerp/osv/orm.py", line 3905, in write
    self._validate(cr, user, ids, context)
  File "/home/openerp/openerp/server/trunk/openerp/osv/orm.py", line 1431, in _validate
    raise except_orm('ValidateError', '\n'.join(error_msgs))
except_orm: ('ValidateError', 'Error occurred while validating the field(s) res_model,src_model: Invalid model name in the action definition.')
[2011-11-28 14:51:42,218][trunk_20111128] INFO:werkzeug:127.0.0.1 - - [28/Nov/2011 14:51:42] "POST /web/dataset/call_button HTTP/1.1" 200 -

review: Needs Fixing
Revision history for this message
DBR (OpenERP) (dbr-openerp) wrote :

Hello,

The both module google_map and base_quality_module are changes already merged.

https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-google_map_wizard-bde/+merge/73215
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-base_module_quality_osv_convert-bde/+merge/73212

So, I am requesting to close this merge proposal.

Thanks.

Unmerged revisions

5239. By DBR (OpenERP)

[IMP] wizard.interface to osv.osv_memory wizard

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'base_module_doc_rst/base_module_doc_rst_wizard.xml'
2--- base_module_doc_rst/base_module_doc_rst_wizard.xml 2011-01-14 00:11:01 +0000
3+++ base_module_doc_rst/base_module_doc_rst_wizard.xml 2011-10-04 10:43:38 +0000
4@@ -1,20 +1,49 @@
5 <?xml version="1.0"?>
6 <openerp>
7 <data>
8- <wizard
9- id="wiz_tech_guide_rst"
10- model="ir.module.module"
11- name="tech.guide.rst"
12- string="Create RST Technical Guide"
13- keyword="client_action_multi"
14- multi="True" />
15-
16- <wizard
17- id="wiz_gen_graph"
18- model="ir.module.module"
19- name="create.relation.graph"
20- string="Generate Relationship Graph"
21- multi="False" />
22+ <record id="view_relationship_graph" model="ir.ui.view">
23+ <field name="name">create.relation.graph.form</field>
24+ <field name="model">create.relation.graph</field>
25+ <field name="type">form</field>
26+ <field name="arch" type="xml">
27+ <form string="Generate Relationship Graph">
28+ <separator string="Relationship Graphs" colspan="6"/>
29+ <button special="cancel" string="Cancel" icon="gtk-cancel"/>
30+ <button name="get_graph" string="Create Graphs" type="object" icon="gtk-ok"/>
31+ </form>
32+ </field>
33+ </record>
34+ <act_window id="wiz_gen_graph"
35+ multi="True"
36+ key2="client_action_multi" name="Generate Relationship Graph1"
37+ context="{'ids': [active_id], 'id': active_id}"
38+ res_model="create.relation.graph" src_model="ir.module.module"
39+ view_mode="form" target="new" view_type="form"
40+ />
41+
42+<!-- tech.guide.rst.form -->
43+
44+ <record id="view_technical_guide" model="ir.ui.view">
45+ <field name="name">tech.guide.rst.form</field>
46+ <field name="model">tech.guide.rst</field>
47+ <field name="type">form</field>
48+ <field name="arch" type="xml">
49+ <form string="Create Technical Guide in rst format">
50+ <separator string="Technical Guide in rst format" colspan="4"/>
51+ <label string="Please choose a file where the Technical Guide will be written." colspan="4"/>
52+ <field name="rst_file" />
53+ <field name="name" invisible="1"/>
54+ </form>
55+ </field>
56+ </record>
57+ <act_window id="wiz_tech_guide_rst"
58+ multi="True"
59+ key2="client_action_multi" name="Create RST Technical Guide2"
60+ context="{'ids': [active_id], 'id': active_id}"
61+ res_model="tech.guide.rst" src_model="ir.module.module"
62+ view_mode="form" target="new" view_type="form"
63+ />
64+
65
66 </data>
67 </openerp>
68
69=== modified file 'base_module_doc_rst/wizard/__init__.py'
70--- base_module_doc_rst/wizard/__init__.py 2011-01-14 00:11:01 +0000
71+++ base_module_doc_rst/wizard/__init__.py 2011-10-04 10:43:38 +0000
72@@ -19,6 +19,6 @@
73 #
74 ##############################################################################
75
76-import wizard_tech_guide_rst
77+import tech_guide_rst
78 import generate_relation_graph
79
80
81=== modified file 'base_module_doc_rst/wizard/generate_relation_graph.py'
82--- base_module_doc_rst/wizard/generate_relation_graph.py 2011-01-14 00:11:01 +0000
83+++ base_module_doc_rst/wizard/generate_relation_graph.py 2011-10-04 10:43:38 +0000
84@@ -20,30 +20,22 @@
85 ##############################################################################
86 import wizard
87 from osv import osv
88+from osv import fields
89 import pooler
90 from tools.translate import _
91
92-form_rep = '''<?xml version="1.0"?>
93-<form string="Relationship Graph">
94- <label colspan="2" string="(Relationship Graphs generated)" align="0.0"/>
95-</form>'''
96-
97-def _get_graph(self, cr, uid, datas, context=None):
98- mod_obj = pooler.get_pool(cr.dbname).get('ir.module.module')
99- modules = mod_obj.browse(cr, uid, datas['ids'], context=context)
100- for module in modules:
101- module_data = mod_obj.get_relation_graph(cr, uid, module.name, context=context)
102- if module_data['module_file']:
103- mod_obj.write(cr, uid, [module.id], {'file_graph': module_data['module_file']}, context=context)
104- return {'type': 'ir.actions.act_window_close'}
105-
106-class create_graph(wizard.interface):
107- states = {
108- 'init': {
109- 'actions': [_get_graph],
110- 'result': {'type': 'form', 'arch': form_rep, 'fields': {}, 'state': [('end','Ok')]}
111- },
112- }
113-create_graph('create.relation.graph')
114-
115-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
116\ No newline at end of file
117+class create_graph(osv.osv_memory):
118+ _name = "create.relation.graph"
119+
120+ def get_graph(self, cr, uid, datas, context=None):
121+ mod_obj = pooler.get_pool(cr.dbname).get('ir.module.module')
122+ modules = mod_obj.browse(cr, uid, context['ids'], context=context)
123+ for module in modules:
124+ module_data = mod_obj.get_relation_graph(cr, uid, module.name, context=context)
125+ if module_data['module_file']:
126+ mod_obj.write(cr, uid, [module.id], {'file_graph': module_data['module_file']}, context=context)
127+ return {'type': 'ir.actions.act_window_close'}
128+
129+create_graph()
130+
131+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
132
133=== renamed file 'base_module_doc_rst/wizard/wizard_tech_guide_rst.py' => 'base_module_doc_rst/wizard/tech_guide_rst.py'
134--- base_module_doc_rst/wizard/wizard_tech_guide_rst.py 2011-01-14 00:11:01 +0000
135+++ base_module_doc_rst/wizard/tech_guide_rst.py 2011-10-04 10:43:38 +0000
136@@ -29,24 +29,11 @@
137 import pooler
138 import os
139 import tools
140+from osv import osv
141+from osv import fields
142
143 import base_module_doc_rst
144
145-
146-choose_file_form = '''<?xml version="1.0"?>
147-<form string="Create Technical Guide in rst format">
148- <separator string="Technical Guide in rst format" colspan="4"/>
149- <label string="Please choose a file where the Technical Guide will be written." colspan="4"/>
150- <field name="rst_file" />
151- <field name="name" invisible="1"/>
152-</form>
153-'''
154-
155-choose_file_fields = {
156- 'rst_file': {'string': 'file', 'type': 'binary', 'required': True, 'readonly': True},
157- 'name': {'string': 'filename', 'type': 'char', 'required': True, 'readonly': True},
158-}
159-
160 class RstDoc(object):
161 def __init__(self, module, objects):
162 self.dico = {
163@@ -322,14 +309,17 @@
164 return s
165
166
167-class wizard_tech_guide_rst(wizard.interface):
168-
169-
170- def _generate(self, cr, uid, data, context):
171+class wizard_tech_guide_rst(osv.osv_memory):
172+ _name = "tech.guide.rst"
173+ _columns = {
174+ 'rst_file': fields.binary('File',required = True, readonly = True),
175+ 'name': fields.char("Filename", size=64, required=True, readonly = True),
176+ }
177+
178+ def _generate(self, cr, uid, context):
179 pool = pooler.get_pool(cr.dbname)
180 module_model = pool.get('ir.module.module')
181- module_ids = data['ids']
182-
183+ module_ids = context['ids']
184 module_index = []
185
186 # create a temporary gzipped tarfile:
187@@ -399,10 +389,7 @@
188 msg = "Temporary file %s could not be deleted. (%s)" % (tgz_tmp_filename, e)
189 logger.notifyChannel("warning", netsvc.LOG_WARNING, msg)
190
191- return {
192- 'rst_file': base64.encodestring(out),
193- 'name': 'modules_technical_guide_rst.tgz'
194- }
195+ return base64.encodestring(out)
196
197 def _get_views(self, cr, uid, module_id, context=None):
198 pool = pooler.get_pool(cr.dbname)
199@@ -491,19 +478,9 @@
200 logger.notifyChannel("base_module_doc_rst", netsvc.LOG_ERROR, msg)
201 return ""
202
203- states = {
204- 'init': {
205- 'actions': [_generate],
206- 'result': {
207- 'type': 'form',
208- 'arch': choose_file_form,
209- 'fields': choose_file_fields,
210- 'state': [
211- ('end', 'Close', 'gtk-close'),
212- ]
213- }
214- },
215- }
216-
217-wizard_tech_guide_rst('tech.guide.rst')
218-
219+ _defaults ={
220+ 'rst_file' : _generate,
221+ 'name': 'modules_technical_guide_rst.tgz'
222+ }
223+
224+wizard_tech_guide_rst()
225
226=== modified file 'base_module_quality/base_module_quality_wizard.xml'
227--- base_module_quality/base_module_quality_wizard.xml 2011-01-14 00:11:01 +0000
228+++ base_module_quality/base_module_quality_wizard.xml 2011-10-04 10:43:38 +0000
229@@ -1,12 +1,47 @@
230 <?xml version="1.0" encoding="utf-8"?>
231 <openerp>
232 <data>
233- <wizard id="quality_detail_save" model="ir.module.module" name="quality_detail_save" string="Report Save" menu="False"/>
234-
235- <wizard string="Quality Check"
236- model="ir.module.module"
237- name="create_quality_check_wiz"
238- id="create_quality_check_id"
239- menu="True"/>
240+ <record id="view_quality_detail_save" model="ir.ui.view">
241+ <field name="name">quality.detail.save.form</field>
242+ <field name="model">quality.detail.save</field>
243+ <field name="type">form</field>
244+ <field name="arch" type="xml">
245+ <form string="Standard entries">
246+ <field name="name"/>
247+ <newline/>
248+ <field name="module_file"/>
249+ </form>
250+ </field>
251+ </record>
252+ <act_window id="quality_detail_save"
253+ multi="True"
254+ key2="client_action_multi" name="quality_detail_save"
255+ context="{'ids': [active_id], 'id': active_id}"
256+ res_model="quality.detail.save" src_model="ir.module.module"
257+ view_mode="form" target="new" view_type="form"
258+ />
259+
260+ <record id="view_create_quality_check_wiz" model="ir.ui.view">
261+ <field name="name">create.quality.check.wiz.form</field>
262+ <field name="model">create.quality.check.wiz</field>
263+ <field name="type">form</field>
264+ <field name="arch" type="xml">
265+ <form string="Quality Check ">
266+ <separator string="Quality Check Results" colspan="6"/>
267+ <button string="_Cancel" icon="gtk-cancel" special="cancel" />
268+ <button name="open_quality_check" type="object" string="Ok" icon="gtk-ok" />
269+ </form>
270+ </field>
271+ </record>
272+
273+ <act_window id="create_quality_check_id"
274+ name="Quality Check"
275+ context="{'ids': [active_id], 'id': active_id}"
276+ res_model="create.quality.check.wiz"
277+ src_model="ir.module.module"
278+ view_mode="form"
279+ target="new"
280+ view_type="form"
281+ />
282 </data>
283-</openerp>
284\ No newline at end of file
285+</openerp>
286
287=== modified file 'base_module_quality/wizard/module_quality_check.py'
288--- base_module_quality/wizard/module_quality_check.py 2011-01-14 00:11:01 +0000
289+++ base_module_quality/wizard/module_quality_check.py 2011-10-04 10:43:38 +0000
290@@ -26,20 +26,21 @@
291 import pooler
292 from osv import osv, fields
293
294-class quality_check(wizard.interface):
295+class quality_check(osv.osv_memory):
296+ _name = "create.quality.check.wiz"
297
298 def _create_quality_check(self, cr, uid, data, context=None):
299 pool = pooler.get_pool(cr.dbname)
300 obj_quality = pool.get('module.quality.check')
301 objs = []
302- for id in data['ids']:
303+ for id in context['ids']:
304 module_data = pool.get('ir.module.module').browse(cr, uid, id)
305 data = obj_quality.check_quality(cr, uid, module_data.name, module_data.state)
306 obj = obj_quality.create(cr, uid, data, context)
307 objs.append(obj)
308 return objs
309
310- def _open_quality_check(self, cr, uid, data, context):
311+ def open_quality_check(self, cr, uid, data, context):
312 obj_ids = self._create_quality_check(cr, uid, data, context)
313 return {
314 'domain': "[('id','in', ["+','.join(map(str,obj_ids))+"])]",
315@@ -50,13 +51,6 @@
316 'type': 'ir.actions.act_window'
317 }
318
319- states = {
320- 'init' : {
321- 'actions' : [],
322- 'result': {'type':'action', 'action':_open_quality_check, 'state':'end'}
323- }
324- }
325-
326-quality_check("create_quality_check_wiz")
327-
328-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
329\ No newline at end of file
330+quality_check()
331+
332+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
333
334=== modified file 'base_module_quality/wizard/quality_save_report.py'
335--- base_module_quality/wizard/quality_save_report.py 2011-01-14 00:11:01 +0000
336+++ base_module_quality/wizard/quality_save_report.py 2011-10-04 10:43:38 +0000
337@@ -23,39 +23,34 @@
338 import cStringIO
339
340 import wizard
341-from osv import osv
342+from osv import osv,fields
343 import pooler
344 from tools.translate import _
345
346-form_rep = '''<?xml version="1.0"?>
347-<form string="Standard entries">
348- <field name="name"/>
349- <newline/>
350- <field name="module_file"/>
351-</form>'''
352-
353-
354-fields_rep = {
355- 'name': {'string': 'File name', 'type': 'char', 'required': True, 'help': 'Save report as .html format', 'size':64},
356- 'module_file': {'string': 'Save report', 'type': 'binary', 'required': True},
357-}
358-
359-def get_detail(self, cr, uid, datas, context=None):
360- data = pooler.get_pool(cr.dbname).get('module.quality.detail').browse(cr, uid, datas['id'])
361- if not data.detail:
362- raise wizard.except_wizard(_('Warning'), _('No report to save!'))
363- buf = cStringIO.StringIO(data.detail)
364- out = base64.encodestring(buf.getvalue())
365- buf.close()
366- return {'module_file': out, 'name': data.name + '.html'}
367-
368-class save_report(wizard.interface):
369- states = {
370- 'init': {
371- 'actions': [get_detail],
372- 'result': {'type': 'form', 'arch': form_rep, 'fields':fields_rep, 'state': [('end','Cancel')]}
373- },
374- }
375-save_report('quality_detail_save')
376-
377-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
378\ No newline at end of file
379+class save_report(osv.osv_memory):
380+ _name = 'quality.detail.save'
381+ _columns = {
382+ 'name': fields.char("File name", size=64, required=True, readonly = True, help = 'Save report as .html format'),
383+ 'module_file': fields.binary('Save report',required = True),
384+ }
385+
386+ def get_detail(self, cr, uid, datas, context=None):
387+ data = pooler.get_pool(cr.dbname).get('module.quality.detail').browse(cr, uid, datas['id'])
388+ if not data.detail:
389+ raise wizard.except_wizard(_('Warning'), _('No report to save!'))
390+ buf = cStringIO.StringIO(data.detail)
391+ out = base64.encodestring(buf.getvalue())
392+ buf.close()
393+ return out
394+
395+ def get_name(self, cr, uid, datas, context=None):
396+ data = pooler.get_pool(cr.dbname).get('module.quality.detail').browse(cr, uid, datas['id'])
397+ return data.name + '.html'
398+
399+ _defaults = {
400+ 'module_file' : get_detail,
401+ 'name': get_name,
402+ }
403+save_report()
404+
405+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
406
407=== modified file 'google_map/google_map_wizard.xml'
408--- google_map/google_map_wizard.xml 2011-01-14 00:11:01 +0000
409+++ google_map/google_map_wizard.xml 2011-10-04 10:43:38 +0000
410@@ -1,12 +1,28 @@
411 <?xml version="1.0" ?>
412 <openerp>
413 <data>
414+ <record id="view_google_map_form" model="ir.ui.view">
415+ <field name="name">launch.map.form</field>
416+ <field name="model">launch.map</field>
417+ <field name="type">form</field>
418+ <field name="arch" type="xml">
419+ <form string="Launch Map">
420+ <group colspan="4" col="8">
421+ <separator string="Launch Google Map" colspan="4"/>
422+ <newline/>
423+ <button string="_Cancel" icon="gtk-cancel" special="cancel" />
424+ <button name="launch_wizard" type="object" string="Ok" icon="gtk-ok" />
425+ </group>
426+ </form>
427+ </field>
428+ </record>
429
430- <wizard
431- string="Launch Google Map"
432- model="res.partner.address"
433- name="google_map_launch"
434- id="wizard_google_map"
435- keyword="client_action_multi"/>
436+ <act_window id="wizard_google_map"
437+ multi="True"
438+ key2="client_action_multi" name="Open Map"
439+ context="{'ids': [active_id], 'id': active_id}"
440+ res_model="launch.map" src_model="res.partner.address"
441+ view_mode="form" target="new" view_type="form"
442+ />
443 </data>
444 </openerp>
445
446=== modified file 'google_map/wizard/google_map_launch.py'
447--- google_map/wizard/google_map_launch.py 2011-01-14 00:11:01 +0000
448+++ google_map/wizard/google_map_launch.py 2011-10-04 10:43:38 +0000
449@@ -1,6 +1,6 @@
450 # -*- coding: utf-8 -*-
451 ##############################################################################
452-#
453+#
454 # OpenERP, Open Source Management Solution
455 # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
456 #
457@@ -15,7 +15,7 @@
458 # GNU Affero General Public License for more details.
459 #
460 # You should have received a copy of the GNU Affero General Public License
461-# along with this program. If not, see <http://www.gnu.org/licenses/>.
462+# along with this program. If not, see <http://www.gnu.org/licenses/>.
463 #
464 ##############################################################################
465
466@@ -25,37 +25,32 @@
467 from osv import fields
468 import time
469
470-def _launch_wizard(self, cr, uid, data, context=None):
471- address_obj= pooler.get_pool(cr.dbname).get('res.partner.address')
472- m= address_obj.browse(cr, uid, data['id'], context=context)
473- url=''
474- url="http://maps.google.com/maps?oi=map&q="
475- if m.street:
476- url+=m.street.replace(' ','+')
477- if m.street2:
478- url+='+'+m.street2.replace(' ','+')
479- if m.city:
480- url+='+'+m.city.replace(' ','+')
481- if m.state_id:
482- url+='+'+m.state_id.name.replace(' ','+')
483- if m.country_id:
484- url+='+'+m.country_id.name.replace(' ','+')
485- if m.zip:
486- url+='+'+m.zip.replace(' ','+')
487- return {
488- 'type': 'ir.actions.act_url',
489- 'url':url,
490- 'target': 'new'
491- }
492-
493-class launch_map(wizard.interface):
494-
495- states= {'init' : {'actions': [],
496- 'result':{'type':'action',
497- 'action': _launch_wizard,
498- 'state':'end'}
499- }
500- }
501-launch_map('google_map_launch')
502+
503+class launch_map(osv.osv_memory):
504+ _name = 'launch.map'
505+
506+ def launch_wizard(self, cr, uid, data, context=None):
507+
508+ address_obj= pooler.get_pool(cr.dbname).get('res.partner.address')
509+ m= address_obj.browse(cr, uid, context.get('id'), context=context)
510+ url=''
511+ url="http://maps.google.com/maps?oi=map&q="
512+ if m.street:
513+ url+=m.street.replace(' ','+')
514+ if m.street2:
515+ url+='+'+m.street2.replace(' ','+')
516+ if m.city:
517+ url+='+'+m.city.replace(' ','+')
518+ if m.state_id:
519+ url+='+'+m.state_id.name.replace(' ','+')
520+ if m.country_id:
521+ url+='+'+m.country_id.name.replace(' ','+')
522+ if m.zip:
523+ url+='+'+m.zip.replace(' ','+')
524+ return {
525+ 'type': 'ir.actions.act_url',
526+ 'url':url,
527+ 'target': 'new'
528+ }
529+launch_map()
530 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
531-
532
533=== modified file 'share/res_users.py'
534--- share/res_users.py 2011-09-30 08:27:49 +0000
535+++ share/res_users.py 2011-10-04 10:43:38 +0000
536@@ -24,7 +24,7 @@
537 _name = "res.groups"
538 _inherit = 'res.groups'
539 _columns = {
540- 'share': fields.boolean('Share Group', readonly=True,
541+ 'share': fields.boolean('Share Group', groups='share.group_share', readonly=True,
542 help="Group created to set access rights for sharing data with some users.")
543 }
544 res_groups()
545@@ -33,7 +33,7 @@
546 _name = 'res.users'
547 _inherit = 'res.users'
548 _columns = {
549- 'share': fields.boolean('Share User', readonly=True,
550+ 'share': fields.boolean('Share User', groups='share.group_share', readonly=True,
551 help="External user with limited access, created only for the purpose of sharing data.")
552 }
553 res_users()

Subscribers

People subscribed via source and target branches

to all changes: