summaryrefslogtreecommitdiff
path: root/addons/mail/static/src
diff options
context:
space:
mode:
authorThibault Delavallée <tde@openerp.com>2012-11-15 13:51:13 +0100
committerThibault Delavallée <tde@openerp.com>2012-11-15 13:51:13 +0100
commit3571ad2a70a8dcdbecd6d749fca6300f393362cc (patch)
tree00c37bc493be57a13edf6b1d380d018c7ba5edb7 /addons/mail/static/src
parent6227e4b5c04b9ee861511a45f7b50806e27cf33c (diff)
parentda9951baf9e8631e97ae0b8bde69eb03e6f34fdf (diff)
[MERGE] Fixes some posting/email_template issues. Also cleans an old hack about res.users view redirected to its related res.partner.
Addons-side: - res.users wraps the 2 posting methods, because mailboxes are still related to the user, not the partner, due to some technical issues - mail.compose.message using email_template: _reopen is back, as the spec of a wizard should be that hitting a button close it. Therefore _reopen is necessaru to reopen the wizard with its previous value, to continue working on it. bzr revid: tde@openerp.com-20121115125113-oxn2vwunsvkinxkd
Diffstat (limited to 'addons/mail/static/src')
-rw-r--r--addons/mail/static/src/js/mail.js19
-rw-r--r--addons/mail/static/src/xml/mail.xml8
2 files changed, 8 insertions, 19 deletions
diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js
index e93a762981b..dc265a343d5 100644
--- a/addons/mail/static/src/js/mail.js
+++ b/addons/mail/static/src/js/mail.js
@@ -24,7 +24,7 @@ openerp.mail = function (session) {
*/
var context_keys = ['default_template_id', 'default_composition_mode',
'default_use_template', 'default_partner_ids', 'default_model',
- 'default_res_id', 'default_content_subtype', , 'default_subject',
+ 'default_res_id', 'default_content_subtype', 'default_subject',
'default_body', 'active_id', 'lang', 'bin_raw', 'tz',
'active_model', 'edi_web_url_view', 'active_ids',
'default_attachment_ids']
@@ -521,8 +521,6 @@ openerp.mail = function (session) {
on_compose_fullmail: function (default_composition_mode) {
if (default_composition_mode == 'reply') {
var context = {
- 'default_model': this.context.default_model,
- 'default_res_id': this.context.default_res_id,
'default_composition_mode': default_composition_mode,
'default_parent_id': this.id,
'default_body': mail.ChatterUtils.get_text2html(this.$el ? (this.$el.find('textarea:not(.oe_compact)').val() || '') : ''),
@@ -532,7 +530,6 @@ openerp.mail = function (session) {
var context = {
'default_model': this.context.default_model,
'default_res_id': this.context.default_res_id,
- 'default_content_subtype': 'html',
'default_composition_mode': default_composition_mode,
'default_parent_id': this.id,
'default_body': mail.ChatterUtils.get_text2html(this.$el ? (this.$el.find('textarea:not(.oe_compact)').val() || '') : ''),
@@ -601,16 +598,15 @@ openerp.mail = function (session) {
this.parent_thread.context
]).done(function (record) {
var thread = self.parent_thread;
-
if (self.options.display_indented_thread < self.thread_level && thread.parent_message) {
- thread = thread.parent_message.parent_thread;
+ var thread = thread.parent_message.parent_thread;
}
+ var root = thread == self.options.root_thread;
// create object and attach to the thread object
thread.message_fetch([['id', 'child_of', [self.id]]], false, [record], function (arg, data) {
- data[0].no_sorted = true;
var message = thread.create_message_object( data[0] );
// insert the message on dom
- thread.insert_message( message, self.$el );
+ thread.insert_message( message, root ? undefined : self.$el, root );
if (thread.parent_message) {
self.$el.remove();
self.parent_thread.compose_message = null;
@@ -1275,7 +1271,7 @@ openerp.mail = function (session) {
* The sort is define by the thread_level (O for newer on top).
* @param : {object} ThreadMessage object
*/
- insert_message: function (message, dom_insert_after) {
+ insert_message: function (message, dom_insert_after, prepend) {
var self=this;
if (this.options.show_compact_message > this.thread_level) {
this.instantiate_compose_message();
@@ -1287,6 +1283,8 @@ openerp.mail = function (session) {
if (dom_insert_after) {
message.insertAfter(dom_insert_after);
+ }if (prepend) {
+ message.prependTo(self.$el);
} else {
message.appendTo(self.$el);
}
@@ -1699,7 +1697,6 @@ openerp.mail = function (session) {
views: [[false, 'form']],
target: 'new',
context: {
- 'default_content_subtype': 'html',
},
};
session.client.action_manager.do_action(action);
@@ -1733,7 +1730,7 @@ openerp.mail = function (session) {
view_type: 'form',
views: [[false, 'form']],
target: 'new',
- context: { 'default_content_subtype': 'html' },
+ context: {},
};
session.client.action_manager.do_action(action);
},
diff --git a/addons/mail/static/src/xml/mail.xml b/addons/mail/static/src/xml/mail.xml
index 2ba1733043a..89fbe45dc36 100644
--- a/addons/mail/static/src/xml/mail.xml
+++ b/addons/mail/static/src/xml/mail.xml
@@ -95,14 +95,6 @@
</t>
</t>
- <t t-name="mail.thread.message.private">
- <div>
- <span class="oe_placeholder_checkbox_private"/>
- <span class="oe_send_private">This email is private.</span>
- <span class="oe_send_public">I wrote for contacts and all my followers.</span>
- </div>
- </t>
-
<!--
template to the recipients list
-->