Bhumi Thakkar (Open ERP) has proposed merging 
lp:~openerp-dev/openerp-web/trunk-bug-909390-bth into lp:openerp-web.

Requested reviews:
  OpenERP R&D Web Team (openerp-dev-web)

For more details, see:
https://code.launchpad.net/~openerp-dev/openerp-web/trunk-bug-909390-bth/+merge/89647

Hello,

I have modified code as required. I have checked if logged user is shared user 
then shortcut add/remove is not displayed. so user can not be able to 
add/remove shortcuts.

Thanks,
Bhumi Thakkar(BTH)
-- 
https://code.launchpad.net/~openerp-dev/openerp-web/trunk-bug-909390-bth/+merge/89647
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openerp-web/trunk-bug-909390-bth.
=== modified file 'addons/web/static/src/js/chrome.js'
--- addons/web/static/src/js/chrome.js	2012-01-22 23:32:02 +0000
+++ addons/web/static/src/js/chrome.js	2012-01-23 10:13:26 +0000
@@ -745,6 +745,18 @@
                     self.session.active_id = id;
                     self.rpc('/web/menu/action', {'menu_id':id}, function(ir_menu_data) {
                         if (ir_menu_data.action.length){
+                            var func = new openerp.web.Model("res.users").get_func("read");
+                            func(self.session.uid, ["share"]).pipe(function(res) {
+                                if(res['share']){
+                                    ir_menu_data.action[0][2].flags = _.extend({
+                                        share_flag : true,
+                                    });
+                                }else{
+                                    ir_menu_data.action[0][2].flags = _.extend({
+                                        share_flag : false,
+                                    });
+                                }
+                            });
                             self.on_action(ir_menu_data.action[0][2]);
                         }
                     });

=== modified file 'addons/web/static/src/js/views.js'
--- addons/web/static/src/js/views.js	2012-01-19 14:48:37 +0000
+++ addons/web/static/src/js/views.js	2012-01-23 10:13:26 +0000
@@ -695,7 +695,7 @@
         var $shortcut_toggle = this.$element.find('.oe-shortcut-toggle');
         if (!this.action.name ||
             !(view.view_type === this.views_src[0].view_type
-                && view.view_id === this.views_src[0].view_id)) {
+                && view.view_id === this.views_src[0].view_id) || this.action.flags.share_flag) {
             $shortcut_toggle.hide();
             return;
         }

=== modified file 'addons/web/static/src/xml/base.xml'
--- addons/web/static/src/xml/base.xml	2012-01-17 12:00:35 +0000
+++ addons/web/static/src/xml/base.xml	2012-01-23 10:13:26 +0000
@@ -454,7 +454,7 @@
             </td>
         </tr>
     </t>
-    <t t-jquery="h2.oe_view_title" t-operation="prepend">
+    <t t-jquery="h2.oe_view_title" t-operation="append">
         <a t-if="self.flags.display_title !== false" class="oe-shortcut-toggle" title="Add / Remove Shortcut..."
             href="javascript: void(0)"> </a>
     </t>

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to