Merge lp:~openerp-dev/openobject-addons/7.0-opw-591036-acl into lp:openobject-addons/7.0

Proposed by Anaël Closson (openerp)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/7.0-opw-591036-acl
Merge into: lp:openobject-addons/7.0
Diff against target: 48 lines (+11/-4)
2 files modified
share/static/src/js/share.js (+8/-3)
share/wizard/share_wizard.py (+3/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/7.0-opw-591036-acl
Reviewer Review Type Date Requested Status
Xavier (Open ERP) Pending
Review via email: mp+166812@code.launchpad.net

Description of the change

FIX OPW 591036 :

Corrects some of the share module behavior :
 * malformed url : calls `http://hostname/login` for login, and uses `active_id` parameter instead of `active`
 * search domain gathered from an improper place that seems to be empty in some cases
   => changed to use the searchview domain information instead

To post a comment you must log in.

Unmerged revisions

9182. By Anaël Closson (openerp)

[FIX] OPW 591036 : share wizard returns action_id instead of action in share url + incorrect url + wrong domain retreival

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'share/static/src/js/share.js'
2--- share/static/src/js/share.js 2012-12-15 16:28:57 +0000
3+++ share/static/src/js/share.js 2013-05-31 14:47:27 +0000
4@@ -6,15 +6,20 @@
5 function launch_wizard(self, view, user_type, invite) {
6 var action = view.getParent().action;
7 var Share = new session.web.DataSet(self, 'share.wizard', view.dataset.get_context());
8- var domain = new session.web.CompoundDomain(view.dataset.domain);
9+ view_manager = view.getParent();
10+ while (view_manager.searchview == void 0) {
11+ view_manager = view.getParent();
12+ }
13+ var search_data = view_manager.searchview.build_search_data();
14+ var domain = new session.web.CompoundDomain(search_data.domains);
15 if (view.fields_view.type == 'form') {
16 domain = new session.web.CompoundDomain(domain, [['id', '=', view.datarecord.id]]);
17 }
18 if (view.fields_view.type == 'form') rec_name = view.datarecord.name;
19 else rec_name = '';
20 session.web.pyeval.eval_domains_and_contexts({
21- domains: [domain],
22- contexts: [view.dataset.context]
23+ domains: search_data.domains,
24+ contexts: search_data.contexts
25 }).done(function (result) {
26 Share.create({
27 name: action.name,
28
29=== modified file 'share/wizard/share_wizard.py'
30--- share/wizard/share_wizard.py 2013-05-21 07:55:53 +0000
31+++ share/wizard/share_wizard.py 2013-05-31 14:47:27 +0000
32@@ -87,13 +87,15 @@
33 # NOTE: take _ids in parameter to allow usage through browse_record objects
34 base_url = self.pool.get('ir.config_parameter').get_param(cr, uid, 'web.base.url', default='', context=context)
35 if base_url:
36- base_url += '/login?db=%(dbname)s&login=%(login)s&key=%(password)s'
37+ base_url += '/?db=%(dbname)s&login=%(login)s&key=%(password)s'
38 extra = context and context.get('share_url_template_extra_arguments')
39 if extra:
40 base_url += '&' + '&'.join('%s=%%(%s)s' % (x,x) for x in extra)
41 hash_ = context and context.get('share_url_template_hash_arguments')
42 if hash_:
43 base_url += '#' + '&'.join('%s=%%(%s)s' % (x,x) for x in hash_)
44+ # FIXME unfortunately, doesn't work for action_id, renaming to action
45+ base_url = base_url.replace('action_id=', 'action=')
46 return base_url
47
48 def _share_root_url(self, cr, uid, ids, _fieldname, _args, context=None):