Merge lp:~hbrunn/therp-backports/6.1_groups_in_dashboards_lp1103919 into lp:therp-backports/web-6.1

Proposed by Holger Brunn (Therp)
Status: Merged
Merged at revision: 2501
Proposed branch: lp:~hbrunn/therp-backports/6.1_groups_in_dashboards_lp1103919
Merge into: lp:therp-backports/web-6.1
Diff against target: 27 lines (+17/-0)
1 file modified
addons/web_dashboard/static/src/js/dashboard.js (+17/-0)
To merge this branch: bzr merge lp:~hbrunn/therp-backports/6.1_groups_in_dashboards_lp1103919
Reviewer Review Type Date Requested Status
Stefan Rijnhart (Opener) (community) Approve
Review via email: mp+146180@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'addons/web_dashboard/static/src/js/dashboard.js'
2--- addons/web_dashboard/static/src/js/dashboard.js 2012-05-18 08:51:05 +0000
3+++ addons/web_dashboard/static/src/js/dashboard.js 2013-02-01 17:23:22 +0000
4@@ -145,6 +145,23 @@
5 action = result.result,
6 view_mode = action_attrs.view_mode;
7
8+ if (result.result.groups_id && result.result.groups_id.length) {
9+ if (openerp.connection.user_groups_id) {
10+ if (_.intersection(openerp.connection.user_groups_id, result.result.groups_id).length==0) {
11+ jQuery('#' + this.view.element_id + '_action_' + index).parent().remove();
12+ return;
13+ }
14+ }
15+ else {
16+ new openerp.web.Model('res.users').call('read', [openerp.connection.uid, ['groups_id']], {}).then(
17+ function(result2) {
18+ openerp.connection.user_groups_id=result2.groups_id;
19+ self.on_load_action(result, index, action_attrs);
20+ });
21+ return;
22+ }
23+ }
24+
25 if (action_attrs.context && action_attrs.context['dashboard_merge_domains_contexts'] === false) {
26 // TODO: replace this 6.1 workaround by attribute on <action/>
27 action.context = action_attrs.context || {};

Subscribers

People subscribed via source and target branches

to all changes: