diff --git a/addons/mail/static/src/css/mail.css b/addons/mail/static/src/css/mail.css
index 0abd8ab1b4e..ff446310d77 100644
--- a/addons/mail/static/src/css/mail.css
+++ b/addons/mail/static/src/css/mail.css
@@ -1,29 +1,7 @@
/* ------------ TOPBAR MAIL BUTTON --------------- */
-
-/* FIXME this css is not very pretty because it uses a
- * 'button' element wich comes with a lot of inappropriate
- * styling. Entypo is also a headache to center properly
- * */
-
-.openerp .oe_topbar_item.oe_topbar_compose_full_email{
- padding: 0px;
- width: 32px;
- height: 32px;
-}
-.openerp .oe_topbar_item.oe_topbar_compose_full_email button{
- position: relative;
- top: -3px; /* centering entypo ... urgh */
- box-sizing: border-box;
- border: none;
- box-shadow: none;
+.oe_systray #oe_topbar_compose_full_email_icon {
color: white;
- background: none;
- text-shadow: 0px 1px 2px black;
- width: 32px;
- height: 32px;
- padding: 0px;
- margin: 0px;
- border-radius: 0px;
+ margin-right: 15px;
}
/* ---- GENERIC FOR MAIL-RELATED STUFF ---- */
diff --git a/addons/mail/static/src/js/announcement.js b/addons/mail/static/src/js/announcement.js
index 0dd438d13af..95d4dc6e1ff 100644
--- a/addons/mail/static/src/js/announcement.js
+++ b/addons/mail/static/src/js/announcement.js
@@ -12,7 +12,9 @@ openerp_announcement = function(instance) {
}
var self = this;
var config_parameter = new instance.web.Model('ir.config_parameter');
- var $bar = this.$el.find('.announcement_bar');
+ $(openerp.qweb.render('WebClient.announcement_bar')).prependTo($('body'));
+ var $bar = $('#announcement_bar_table');
+
return config_parameter.call('get_param', ['database.uuid', false]).then(function(dbuuid) {
if (!dbuuid) {
return;
diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js
index 04e99f5de0e..dbe7d54aade 100644
--- a/addons/mail/static/src/js/mail.js
+++ b/addons/mail/static/src/js/mail.js
@@ -1996,11 +1996,12 @@ openerp.mail = function (session) {
template:'mail.ComposeMessageTopButton',
start: function () {
- this.$('button').on('click', this.on_compose_message );
+ this.$el.on('click', this.on_compose_message);
this._super();
},
on_compose_message: function (event) {
+ event.preventDefault();
event.stopPropagation();
var action = {
type: 'ir.actions.act_window',
@@ -2021,7 +2022,8 @@ openerp.mail = function (session) {
this._super.apply(this, arguments);
this.update_promise.then(function() {
var mail_button = new session.web.ComposeMessageTopButton();
- mail_button.appendTo(session.webclient.$el.find('.oe_systray'));
+ mail_button.appendTo(session.webclient.$el.parents().find('.oe_systray'));
+ openerp.web.bus.trigger('resize'); // Re-trigger the reflow logic
});
},
});
diff --git a/addons/mail/static/src/xml/announcement.xml b/addons/mail/static/src/xml/announcement.xml
index 84dfa426796..46397861992 100644
--- a/addons/mail/static/src/xml/announcement.xml
+++ b/addons/mail/static/src/xml/announcement.xml
@@ -1,12 +1,18 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
diff --git a/addons/mail/static/src/xml/mail.xml b/addons/mail/static/src/xml/mail.xml
index 62ecdcd89d6..c79b95224b1 100644
--- a/addons/mail/static/src/xml/mail.xml
+++ b/addons/mail/static/src/xml/mail.xml
@@ -340,9 +340,11 @@
render of the button on the user bar for open wizard compose message
-->
-
-
-
-
\ No newline at end of file
diff --git a/addons/website_forum/views/website_forum.xml b/addons/website_forum/views/website_forum.xml
index cdf941d58ad..e4f9e0c04b9 100644
--- a/addons/website_forum/views/website_forum.xml
+++ b/addons/website_forum/views/website_forum.xml
@@ -1019,5 +1019,12 @@
+
+
+
diff --git a/openerp/addons/base/ir/ir_ui_menu.py b/openerp/addons/base/ir/ir_ui_menu.py
index c77da3a6b67..8ace579defb 100644
--- a/openerp/addons/base/ir/ir_ui_menu.py
+++ b/openerp/addons/base/ir/ir_ui_menu.py
@@ -23,6 +23,7 @@
import base64
import re
import threading
+import operator
from openerp.tools.safe_eval import safe_eval as eval
from openerp import tools
import openerp.modules
@@ -32,6 +33,7 @@ from openerp import SUPERUSER_ID
MENU_ITEM_SEPARATOR = "/"
+
class ir_ui_menu(osv.osv):
_name = 'ir.ui.menu'
@@ -338,6 +340,63 @@ class ir_ui_menu(osv.osv):
res[menu.id]['needaction_counter'] = obj._needaction_count(cr, uid, dom, context=context)
return res
+ def get_user_roots(self, cr, uid, context=None):
+ """ Return all root menu ids visible for the user.
+
+ :return: the root menu ids
+ :rtype: list(int)
+ """
+ menu_domain = [('parent_id', '=', False)]
+ return self.search(cr, uid, menu_domain, context=context)
+
+ def load_menus(self, cr, uid, context=None):
+ """ Loads all menu items (all applications and their sub-menus).
+
+ :return: the menu root
+ :rtype: dict('children': menu_nodes)
+ """
+ fields = ['name', 'sequence', 'parent_id', 'action']
+ menu_root_ids = self.get_user_roots(cr, uid, context=context)
+ menu_roots = self.read(cr, uid, menu_root_ids, fields, context=context) if menu_root_ids else []
+ menu_root = {
+ 'id': False,
+ 'name': 'root',
+ 'parent_id': [-1, ''],
+ 'children': menu_roots,
+ 'all_menu_ids': menu_root_ids,
+ }
+ if not menu_roots:
+ return menu_root
+
+ # menus are loaded fully unlike a regular tree view, cause there are a
+ # limited number of items (752 when all 6.1 addons are installed)
+ menu_ids = self.search(cr, uid, [('id', 'child_of', menu_root_ids)], 0, False, False, context=context)
+ menu_items = self.read(cr, uid, menu_ids, fields, context=context)
+ # adds roots at the end of the sequence, so that they will overwrite
+ # equivalent menu items from full menu read when put into id:item
+ # mapping, resulting in children being correctly set on the roots.
+ menu_items.extend(menu_roots)
+ menu_root['all_menu_ids'] = menu_ids # includes menu_root_ids!
+
+ # make a tree using parent_id
+ menu_items_map = dict(
+ (menu_item["id"], menu_item) for menu_item in menu_items)
+ for menu_item in menu_items:
+ if menu_item['parent_id']:
+ parent = menu_item['parent_id'][0]
+ else:
+ parent = False
+ if parent in menu_items_map:
+ menu_items_map[parent].setdefault(
+ 'children', []).append(menu_item)
+
+ # sort by sequence a tree using parent_id
+ for menu_item in menu_items:
+ menu_item.setdefault('children', []).sort(
+ key=operator.itemgetter('sequence'))
+
+ return menu_root
+
_columns = {
'name': fields.char('Menu', required=True, translate=True),
'sequence': fields.integer('Sequence'),