[MERGE] Sync with trunk
bzr revid: tde@openerp.com-20140106135700-rt0g44w5xmpbtxiu
This commit is contained in:
@@ -81,16 +81,19 @@ Main Features
|
||||
'css': [
|
||||
'static/src/css/mail.css',
|
||||
'static/src/css/mail_group.css',
|
||||
'static/src/css/announcement.css',
|
||||
],
|
||||
'js': [
|
||||
'static/src/js/mail.js',
|
||||
'static/src/js/mail_followers.js',
|
||||
'static/src/js/many2many_tags_email.js',
|
||||
'static/src/js/announcement.js',
|
||||
'static/src/js/suggestions.js',
|
||||
],
|
||||
'qweb': [
|
||||
'static/src/xml/mail.xml',
|
||||
'static/src/xml/mail_followers.xml',
|
||||
'static/src/xml/announcement.xml',
|
||||
'static/src/xml/suggestions.xml',
|
||||
],
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -201,7 +201,7 @@ class mail_message(osv.Model):
|
||||
|
||||
def _get_default_from(self, cr, uid, context=None):
|
||||
this = self.pool.get('res.users').browse(cr, SUPERUSER_ID, uid, context=context)
|
||||
if this.alias_domain:
|
||||
if this.alias_name and this.alias_domain:
|
||||
return '%s <%s@%s>' % (this.name, this.alias_name, this.alias_domain)
|
||||
elif this.email:
|
||||
return '%s <%s>' % (this.name, this.email)
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
.openerp .annoucement_bar {
|
||||
display: none;
|
||||
}
|
||||
@@ -90,7 +90,9 @@
|
||||
}
|
||||
|
||||
.openerp .oe_group_button {
|
||||
padding-top: 7px;
|
||||
position: absolute;
|
||||
padding-bottom: 50px;
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.openerp .oe_group_button .oe_group_join {
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
openerp_announcement = function(instance) {
|
||||
instance.web.WebClient.include({
|
||||
show_application: function() {
|
||||
return $.when(this._super.apply(this, arguments)).then(this.proxy('show_annoucement_bar'));
|
||||
},
|
||||
_ab_location: function(dbuuid) {
|
||||
return _.str.sprintf('https://services.openerp.com/openerp-enterprise/ab/css/%s.css', dbuuid);
|
||||
},
|
||||
show_annoucement_bar: function() {
|
||||
if (this.session.get_cookie('ab') === 'c') {
|
||||
return;
|
||||
}
|
||||
var self = this;
|
||||
var config_parameter = new instance.web.Model('ir.config_parameter');
|
||||
var $bar = this.$el.find('.announcement_bar');
|
||||
return config_parameter.call('get_param', ['database.uuid', false]).then(function(dbuuid) {
|
||||
if (!dbuuid) {
|
||||
return;
|
||||
}
|
||||
var $link = $bar.find('.url a');
|
||||
$link.attr('href', _.str.sprintf('%s/%s', $link.attr('href'), dbuuid));
|
||||
var $css = $('<link />').attr({
|
||||
rel : 'stylesheet',
|
||||
type: 'text/css',
|
||||
media: 'screen',
|
||||
href: self._ab_location(dbuuid)
|
||||
});
|
||||
$css.on('load', function() {
|
||||
var close = function() {
|
||||
var ttl = 7*24*60*60;
|
||||
self.session.set_cookie('ab', 'c', ttl);
|
||||
$bar.slideUp('slow');
|
||||
};
|
||||
$bar.find('.close').on('click', close);
|
||||
self.trigger('ab_loaded', $bar);
|
||||
});
|
||||
|
||||
$('head').append($css);
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
@@ -6,6 +6,7 @@ openerp.mail = function (session) {
|
||||
|
||||
openerp_mail_followers(session, mail); // import mail_followers.js
|
||||
openerp_FieldMany2ManyTagsEmail(session); // import manyy2many_tags_email.js
|
||||
openerp_announcement(session);
|
||||
|
||||
/**
|
||||
* ------------------------------------------------------------
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<templates id="template" xml:space="preserve">
|
||||
<t t-extend="WebClient">
|
||||
<t t-jquery="table.oe_webclient" t-operation="prepend">
|
||||
<td colspan="2" class="announcement_bar">
|
||||
<span class="message"></span>
|
||||
<span class="url"><a href="https://services.openerp.com/openerp-enterprise/ab/register" target="_blank"></a></span>
|
||||
<span class="close"></span>
|
||||
</td>
|
||||
</t>
|
||||
</t>
|
||||
</templates>
|
||||
Reference in New Issue
Block a user