[IMP] share: now restricted to the technical group, as this is a very
authorBhavik Bagdiya <bba@openerp.com>
Mon, 25 Aug 2014 13:12:33 +0000 (18:42 +0530)
committerThibault Delavallée <tde@openerp.com>
Tue, 2 Sep 2014 09:17:08 +0000 (11:17 +0200)
tricky feature. Also changed the order in the more menu.

addons/share/static/src/js/share.js
addons/web/static/src/js/views.js

index 2211295..ed9366f 100644 (file)
@@ -56,14 +56,18 @@ openerp.share = function(session) {
             var self = this;
             this._super(this);
             has_share(function() {
-                self.add_items('other', [
-                    {   label: _t('Share'),
-                        callback: self.on_click_share,
-                        classname: 'oe_share' },
-                    {   label: _t('Embed'),
-                        callback: self.on_click_share_link,
-                        classname: 'oe_share' },
-                ]);
+                new session.web.Model('res.users').call('has_group', ['base.group_no_one']).done(function(group_status) {
+                    if (group_status == true) {
+                        self.add_items('other', [
+                            {   label: _t('Share'),
+                                callback: self.on_click_share,
+                                classname: 'oe_share' },
+                            {   label: _t('Embed'),
+                                callback: self.on_click_share_link,
+                                classname: 'oe_share' },
+                        ]);
+                    }
+                });
             });
         },
 
index 93ca3fe..a3fc278 100644 (file)
@@ -1209,7 +1209,7 @@ instance.web.Sidebar = instance.web.Widget.extend({
     add_items: function(section_code, items) {
         var self = this;
         if (items) {
-            this.items[section_code].push.apply(this.items[section_code],items);
+            this.items[section_code].unshift.apply(this.items[section_code],items);
             this.redraw();
         }
     },