diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml
index 49bbe8d3a4d..e85a0002bf8 100644
--- a/addons/account/account_invoice_view.xml
+++ b/addons/account/account_invoice_view.xml
@@ -157,33 +157,39 @@
-
-
-
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
-
-
-
-
-
+
-
+
-
-
@@ -196,10 +202,11 @@
-
-
-
+
+
+
+
@@ -232,16 +239,17 @@
-
+
+
-
-
-
-
-
+
+
+
+
+
diff --git a/addons/account_anglo_saxon/product_view.xml b/addons/account_anglo_saxon/product_view.xml
index 8a79d96d1c4..b88f8f2db42 100644
--- a/addons/account_anglo_saxon/product_view.xml
+++ b/addons/account_anglo_saxon/product_view.xml
@@ -34,12 +34,11 @@
form
-
+
+
diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml
index a2f3c30c611..7476e709d6b 100644
--- a/addons/crm/crm_lead_view.xml
+++ b/addons/crm/crm_lead_view.xml
@@ -172,9 +172,9 @@
-
+
+
diff --git a/addons/fetchmail/fetchmail.py b/addons/fetchmail/fetchmail.py
index cddcf642dc4..55923c3043a 100644
--- a/addons/fetchmail/fetchmail.py
+++ b/addons/fetchmail/fetchmail.py
@@ -151,7 +151,7 @@ openerp_mailgate.py -u %(uid)d -p PASSWORD -o %(model)s -d %(dbname)s --host=HOS
connection = server.connect()
server.write({'state':'done'})
except Exception, e:
- logger.exception("Failed to connect to %s server %s", server.type, server.name)
+ _logger.exception("Failed to connect to %s server %s", server.type, server.name)
raise osv.except_osv(_("Connection test failed!"), _("Here is what we got instead:\n %s") % tools.ustr(e))
finally:
try:
@@ -177,7 +177,7 @@ openerp_mailgate.py -u %(uid)d -p PASSWORD -o %(model)s -d %(dbname)s --host=HOS
mail_thread = self.pool.get('mail.thread')
action_pool = self.pool.get('ir.actions.server')
for server in self.browse(cr, uid, ids, context=context):
- logger.info('start checking for new emails on %s server %s', server.type, server.name)
+ _logger.info('start checking for new emails on %s server %s', server.type, server.name)
context.update({'fetchmail_server_id': server.id, 'server_type': server.type})
count = 0
imap_server = False
@@ -198,9 +198,9 @@ openerp_mailgate.py -u %(uid)d -p PASSWORD -o %(model)s -d %(dbname)s --host=HOS
imap_server.store(num, '+FLAGS', '\\Seen')
cr.commit()
count += 1
- logger.info("fetched/processed %s email(s) on %s server %s", count, server.type, server.name)
+ _logger.info("fetched/processed %s email(s) on %s server %s", count, server.type, server.name)
except Exception, e:
- logger.exception("Failed to fetch mail from %s server %s", server.type, server.name)
+ _logger.exception("Failed to fetch mail from %s server %s", server.type, server.name)
finally:
if imap_server:
imap_server.close()
@@ -222,9 +222,9 @@ openerp_mailgate.py -u %(uid)d -p PASSWORD -o %(model)s -d %(dbname)s --host=HOS
action_pool.run(cr, uid, [server.action_id.id], {'active_id': res_id, 'active_ids':[res_id]})
pop_server.dele(num)
cr.commit()
- logger.info("fetched/processed %s email(s) on %s server %s", numMsgs, server.type, server.name)
+ _logger.info("fetched/processed %s email(s) on %s server %s", numMsgs, server.type, server.name)
except Exception, e:
- logger.exception("Failed to fetch mail from %s server %s", server.type, server.name)
+ _logger.exception("Failed to fetch mail from %s server %s", server.type, server.name)
finally:
if pop_server:
pop_server.quit()
diff --git a/addons/mail/__openerp__.py b/addons/mail/__openerp__.py
index 95ce7d5619d..8ba3c02b0b3 100644
--- a/addons/mail/__openerp__.py
+++ b/addons/mail/__openerp__.py
@@ -86,6 +86,7 @@ The main features are:
'static/src/css/mail_group.css',
],
'js': [
+ 'static/src/js/jquery.expander.min.js',
'static/src/js/mail.js',
],
'qweb': [
diff --git a/addons/mail/mail_group_view.xml b/addons/mail/mail_group_view.xml
index 921c3b528c4..4b9cfd09c3d 100644
--- a/addons/mail/mail_group_view.xml
+++ b/addons/mail/mail_group_view.xml
@@ -51,28 +51,30 @@
diff --git a/addons/mail/mail_message.py b/addons/mail/mail_message.py
index 1c1e980e3ed..301657ba4c2 100644
--- a/addons/mail/mail_message.py
+++ b/addons/mail/mail_message.py
@@ -96,11 +96,24 @@ class mail_message_common(osv.osv_memory):
continue
result[message.id] = self.pool.get(message.model).name_get(cr, uid, [message.res_id], context=context)[0][1]
return result
-
+
+ def name_get(self, cr, uid, ids, context=None):
+ res = []
+ for message in self.browse(cr, uid, ids, context=context):
+ name = ''
+ if message.subject:
+ name = '%s: ' % (message.subject)
+ if message.body_text:
+ name = '%s%s ' % (name, message.body_text[0:20])
+ if message.date:
+ name = '%s(%s)' % (name, message.date)
+ res.append((message.id, name))
+ return res
+
_name = 'mail.message.common'
_rec_name = 'subject'
_columns = {
- 'subject': fields.char('Subject', size=512, required=True),
+ 'subject': fields.char('Subject', size=512),
'model': fields.char('Related Document Model', size=128, select=1),
'res_id': fields.integer('Related Document ID', select=1),
'record_name': fields.function(get_record_name, type='string', string='Message Record Name',
diff --git a/addons/mail/mail_thread.py b/addons/mail/mail_thread.py
index e0f2bfaf455..d0af1ed8841 100644
--- a/addons/mail/mail_thread.py
+++ b/addons/mail/mail_thread.py
@@ -746,13 +746,8 @@ class mail_thread(osv.osv):
self.message_append_note(cr, uid, [id], 'res.log', message, context=context)
def message_append_note(self, cr, uid, ids, subject=None, body=None, parent_id=False, type='notification', subtype='html', context=None):
- if subject is None:
- if type == 'notification':
- subject = _('System notification')
- elif type == 'comment' and not parent_id:
- subject = _('Comment')
- elif type == 'comment' and parent_id:
- subject = _('Reply')
+ if type in ['notification', 'reply']:
+ subject = None
if subtype == 'html':
body_html = body
body_text = body
diff --git a/addons/mail/static/src/css/mail.css b/addons/mail/static/src/css/mail.css
index 2421b28fbcb..0cf932f9a25 100644
--- a/addons/mail/static/src/css/mail.css
+++ b/addons/mail/static/src/css/mail.css
@@ -314,8 +314,8 @@
text-align: justify;
}
-.openerp .oe_mail_msg_tail {
- display: none;
+.openerp .oe_mail_msg_body span.oe_mail_msg_tail {
+ display: inline;
}
/* Read more/less link */
diff --git a/addons/mail/static/src/css/mail_group.css b/addons/mail/static/src/css/mail_group.css
index 90261499753..048b7a06415 100644
--- a/addons/mail/static/src/css/mail_group.css
+++ b/addons/mail/static/src/css/mail_group.css
@@ -1,3 +1,40 @@
+/* ------------------------------ */
+/* Group Form */
+/* ------------------------------ */
+
+/* Resize sheet width */
+.openerp .oe_form_sheetbg.openerp_mail_group_sheet {
+ min-height: 0px;
+ max-height: none;
+}
+
+.openerp .oe_form_sheetbg.openerp_mail_group_sheet .oe_form_sheet {
+ min-height: 0px;
+ max-height: none;
+ padding: 0px 18px;
+ max-width: 80%;
+}
+
+/* Resize footer width */
+.openerp .oe_form footer.openerp_mail_group_footer {
+ max-width: 80%;
+}
+
+/* Resize group logo */
+.openerp .oe_form_sheetbg.openerp_mail_group_sheet .oe_form_field_image > img {
+ max-width: 100px;
+ max-height: 100px;
+}
+
+/* Resize group description */
+.openerp .oe_form_sheetbg.openerp_mail_group_sheet .oe_form_field_text > textarea {
+ height: 40px;
+}
+
+/* ------------------------------ */
+/* Group Kanban */
+/* ------------------------------ */
+
.oe_group_vignette {
padding: 8px 0;
min-height: 100px;
@@ -71,9 +108,3 @@
.oe_group_details li {
margin: 2px 0;
}
-
-.oe_group_description {
-}
-
-.oe_kanban_record div.true {
-}
diff --git a/addons/mail/static/src/js/jquery.expander.min.js b/addons/mail/static/src/js/jquery.expander.min.js
new file mode 100644
index 00000000000..2c61251fcf0
--- /dev/null
+++ b/addons/mail/static/src/js/jquery.expander.min.js
@@ -0,0 +1,24 @@
+/*!
+ * jQuery Expander Plugin v1.4.2
+ *
+ * Date: Sat Mar 31 20:51:48 2012 EDT
+ * Requires: jQuery v1.3+
+ *
+ * Copyright 2011, Karl Swedberg
+ * Dual licensed under the MIT and GPL licenses (just like jQuery):
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+ *
+ *
+ *
+ *
+*/
+(function(c){c.expander={version:"1.4.2",defaults:{slicePoint:100,preserveWords:true,widow:4,expandText:"read more",expandPrefix:"… ",expandAfterSummary:false,summaryClass:"summary",detailClass:"details",moreClass:"read-more",lessClass:"read-less",collapseTimer:0,expandEffect:"slideDown",expandSpeed:250,collapseEffect:"slideUp",collapseSpeed:200,userCollapse:true,userCollapseText:"read less",userCollapsePrefix:" ",onSlice:null,beforeExpand:null,afterExpand:null,onCollapse:null}};c.fn.expander=
+function(l){function J(a,d){var g="span",h=a.summary;if(d){g="div";if(x.test(h)&&!a.expandAfterSummary)h=h.replace(x,a.moreLabel+"$1");else h+=a.moreLabel;h=''+h+"
"}else h+=a.moreLabel;return[h,"<",g+' class="'+a.detailClass+'"',">",a.details,""+g+">"].join("")}function K(a){var d=''+a.expandPrefix;d+=''+a.expandText+"";return d}function y(a,d){if(a.lastIndexOf("<")>a.lastIndexOf(">"))a=a.slice(0,a.lastIndexOf("<"));
+if(d)a=a.replace(L,"");return c.trim(a)}function z(a,d){d.stop(true,true)[a.collapseEffect](a.collapseSpeed,function(){d.prev("span."+a.moreClass).show().length||d.parent().children("div."+a.summaryClass).show().find("span."+a.moreClass).show()})}function M(a,d,g){if(a.collapseTimer)A=setTimeout(function(){z(a,d);c.isFunction(a.onCollapse)&&a.onCollapse.call(g,false)},a.collapseTimer)}var v="init";if(typeof l=="string"){v=l;l={}}var o=c.extend({},c.expander.defaults,l),N=/^<(?:area|br|col|embed|hr|img|input|link|meta|param).*>$/i,
+L=o.wordEnd||/(&(?:[^;]+;)?|[a-zA-Z\u00C0-\u0100]+)$/,B=/<\/?(\w+)[^>]*>/g,C=/<(\w+)[^>]*>/g,D=/<\/(\w+)>/g,x=/(<\/[^>]+>)\s*$/,O=/^<[^>]+>.?/,A;l={init:function(){this.each(function(){var a,d,g,h,m,i,p,w,E=[],t=[],q={},r=this,f=c(this),F=c([]),b=c.meta?c.extend({},o,f.data()):o;i=!!f.find("."+b.detailClass).length;var s=!!f.find("*").filter(function(){return/^block|table|list/.test(c(this).css("display"))}).length,u=(s?"div":"span")+"."+b.detailClass,G="span."+b.moreClass,P=b.expandSpeed||0,n=c.trim(f.html());
+c.trim(f.text());var e=n.slice(0,b.slicePoint);if(!c.data(this,"expander")){c.data(this,"expander",true);c.each(["onSlice","beforeExpand","afterExpand","onCollapse"],function(j,k){q[k]=c.isFunction(b[k])});e=y(e);for(d=e.replace(B,"").length;d")}else m.splice(I,1)});t.reverse();if(i){i=f.find(u).remove().html();e=f.html();n=e+i;a=""}else{i=n.slice(e.length);a=c.trim(i.replace(B,""));if(a===""||a.split(/\s+/).length'+b.userCollapsePrefix+''+b.userCollapseText+"");f.find("span."+
+b.lessClass+" a").unbind("click.expander").bind("click.expander",function(j){j.preventDefault();clearTimeout(A);j=c(this).closest(u);z(b,j);q.onCollapse&&b.onCollapse.call(r,true)})}})},destroy:function(){if(this.data("expander")){this.removeData("expander");this.each(function(){var a=c(this),d=c.meta?c.extend({},o,a.data()):o,g=a.find("."+d.detailClass).contents();a.find("."+d.moreClass).remove();a.find("."+d.summaryClass).remove();a.find("."+d.detailClass).after(g).remove();a.find("."+d.lessClass).remove()})}}};
+l[v]&&l[v].call(this);return this};c.fn.expander.defaults=c.expander.defaults})(jQuery);
diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js
index 5633a4bdae0..e724a8bcbd0 100644
--- a/addons/mail/static/src/js/mail.js
+++ b/addons/mail/static/src/js/mail.js
@@ -302,17 +302,20 @@ openerp.mail = function(session) {
record.body = this.do_clean_text(record.body);
record.body = this.do_replace_internal_links(record.body);
- // split for see more
- var split = this.do_truncate_string(record.body, this.params.msg_more_limit);
- record.body_head = split[0];
- record.body_tail = split[1];
-
// format date according to the user timezone
record.date = session.web.format_value(record.date, {type:"datetime"});
-
var rendered = session.web.qweb.render('mail.Thread.message', {'record': record, 'thread': this, 'params': this.params, 'display': this.display});
- $( rendered).appendTo(this.$element.children('div.oe_mail_thread_display:first'));
+ $(rendered).appendTo(this.$element.children('div.oe_mail_thread_display:first'));
+ // expand feature
+ this.$element.find('div.oe_mail_msg_body:last').expander({
+ slicePoint: this.params.msg_more_limit,
+ expandText: 'see more',
+ userCollapseText: 'see less',
+ detailClass: 'oe_mail_msg_tail',
+ moreClass: 'oe_mail_expand',
+ lesClass: 'oe_mail_reduce',
+ });
},
/**
@@ -447,20 +450,6 @@ openerp.mail = function(session) {
return this.session.prefix + '/web/binary/image?session_id=' + this.session.session_id + '&model=' + model + '&field=' + field + '&id=' + (id || '');
},
- /**
- * @param {String} string to truncate
- * @param {Number} max number of chars to display
- * @returns {String} truncated string
- */
- do_truncate_string: function(string, max_length) {
- // multiply by 1.2: prevent truncating an just too little long string
- if (string.length <= (max_length * 1.2)) {
- return [string, ""];
- } else {
- return [string.slice(0, max_length), string.slice(max_length)];
- }
- },
-
/** Removes html tags, except b, em, br */
do_clean_text: function (string) {
var html = $('').text(string.replace(/\s+/g, ' ')).html().replace(new RegExp('<(/)?(b|em|br|br /)\\s*>', 'gi'), '<$1$2>');
diff --git a/addons/mail/static/src/xml/mail.xml b/addons/mail/static/src/xml/mail.xml
index 34445c48f8d..2eb3a390933 100644
--- a/addons/mail/static/src/xml/mail.xml
+++ b/addons/mail/static/src/xml/mail.xml
@@ -91,10 +91,7 @@