[IMP]mail: reply to parent : author and partners
bzr revid: chm@openerp.com-20121012130232-5enz0p8vd0ta85o3
This commit is contained in:
parent
41c039a0a0
commit
407a7eca27
|
@ -151,7 +151,7 @@ class mail_message(osv.Model):
|
|||
'date': lambda *a: fields.datetime.now(),
|
||||
'author_id': lambda self, cr, uid, ctx={}: self._get_default_author(cr, uid, ctx),
|
||||
'body': '',
|
||||
'is_private': True,
|
||||
'is_private': False,
|
||||
}
|
||||
|
||||
#------------------------------------------------------
|
||||
|
@ -215,6 +215,7 @@ class mail_message(osv.Model):
|
|||
'date': msg.date,
|
||||
'author_id': author_id,
|
||||
'is_author': is_author,
|
||||
'is_private': msg.is_private,
|
||||
'partner_ids': partner_ids,
|
||||
'parent_id': msg.parent_id and msg.parent_id.id or False,
|
||||
'vote_user_ids': vote_ids,
|
||||
|
|
|
@ -89,28 +89,28 @@
|
|||
<field name="name">Inbox</field>
|
||||
<field name="tag">mail.wall</field>
|
||||
<field name="params" eval=""{'domain': [('notification_ids.partner_id.user_ids', 'in', [uid]),('notification_ids.read', '=', False)],
|
||||
'context': {'default_model': 'res.partner'} }""/>
|
||||
'context': {'default_model': 'res.partner', 'default_is_private': False} }""/>
|
||||
</record>
|
||||
|
||||
<record id="action_mail_to_me_feeds" model="ir.actions.client">
|
||||
<field name="name">To: me</field>
|
||||
<field name="tag">mail.wall</field>
|
||||
<field name="params" eval=""{'domain': [('partner_ids.user_ids', 'in', [uid]),('notification_ids.read', '=', False),('create_uid', '!=', uid)],
|
||||
'context': {'default_model': 'res.partner'} }""/>
|
||||
'context': {'default_model': 'res.partner', 'default_is_private': False} }""/>
|
||||
</record>
|
||||
|
||||
<record id="action_mail_archives_feeds" model="ir.actions.client">
|
||||
<field name="name">Archives</field>
|
||||
<field name="tag">mail.wall</field>
|
||||
<field name="params" eval=""{'domain': [('notification_ids.partner_id.user_ids', 'in', [uid]),('notification_ids.read', '=', True)],
|
||||
'context': {'default_model': 'res.partner'} }""/>
|
||||
'context': {'default_model': 'res.partner', 'default_is_private': False} }""/>
|
||||
</record>
|
||||
|
||||
<record id="action_mail_sent_feeds" model="ir.actions.client">
|
||||
<field name="name">Sent</field>
|
||||
<field name="tag">mail.wall</field>
|
||||
<field name="params" eval=""{'domain': [('create_uid', '=', uid)],
|
||||
'context': {'default_model': 'res.partner'} }""/>
|
||||
'context': {'default_model': 'res.partner', 'default_is_private': False} }""/>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -683,7 +683,7 @@ class mail_thread(osv.AbstractModel):
|
|||
if parent_id:
|
||||
msg = messages.browse(cr, uid, parent_id, context=context)
|
||||
values["is_private"] = msg.is_private or False
|
||||
values["partner_ids"] = [(4, partner.id) for partner in msg.partner_ids]
|
||||
values["partner_ids"] = [(4, partner.id) for partner in msg.partner_ids] + [(4, msg.author_id.id)]
|
||||
|
||||
print values
|
||||
# Avoid warnings about non-existing fields
|
||||
|
|
|
@ -144,7 +144,6 @@ openerp.mail = function(session) {
|
|||
|
||||
this.parent_thread= parent.messages!= undefined ? parent : false;
|
||||
|
||||
|
||||
this.ds_attachment = new session.web.DataSetSearch(this, 'ir.attachment');
|
||||
this.fileupload_id = _.uniqueId('oe_fileupload_temp');
|
||||
$(window).on(self.fileupload_id, self.on_attachment_loaded);
|
||||
|
@ -302,7 +301,7 @@ openerp.mail = function(session) {
|
|||
'default_res_model': this.context.default_res_model,
|
||||
'default_res_id': this.context.default_res_id,
|
||||
'default_content_subtype': 'html',
|
||||
'default_is_private': true,
|
||||
'default_is_private': this.is_private,
|
||||
'default_parent_id': this.id,
|
||||
'default_body': mail.ChatterUtils.get_text2html(this.$('textarea').val() || ''),
|
||||
'default_attachment_ids': attachments,
|
||||
|
@ -478,6 +477,7 @@ openerp.mail = function(session) {
|
|||
this.res_id = param.res_id || false;
|
||||
this.type = param.type || false;
|
||||
this.is_author = param.is_author || false;
|
||||
this.is_private = param.is_private || false;
|
||||
this.subject = param.subject || false;
|
||||
this.name = param.name || false;
|
||||
this.record_name = param.record_name || false;
|
||||
|
@ -1004,32 +1004,32 @@ openerp.mail = function(session) {
|
|||
},
|
||||
|
||||
/** Displays a message or an expandable message */
|
||||
insert_message: function (message) {
|
||||
insert_message: function (record) {
|
||||
var self=this;
|
||||
|
||||
this.$("li.oe_wall_no_message").remove();
|
||||
|
||||
if(message.type=='expandable'){
|
||||
if(record.type=='expandable'){
|
||||
var message = new mail.ThreadExpandable(self, {
|
||||
'domain': message.domain,
|
||||
'domain': record.domain,
|
||||
'context': {
|
||||
'default_model': message.model,
|
||||
'default_res_id': message.res_id,
|
||||
'default_parent_id': message.id },
|
||||
'parameters': message
|
||||
'default_model': record.model,
|
||||
'default_res_id': record.res_id,
|
||||
'default_parent_id': record.id },
|
||||
'parameters': record
|
||||
});
|
||||
} else {
|
||||
var message = new mail.ThreadMessage(self, {
|
||||
'domain': message.domain,
|
||||
'domain': record.domain,
|
||||
'context': {
|
||||
'default_model': message.model,
|
||||
'default_res_id': message.res_id,
|
||||
'default_parent_id': message.id },
|
||||
'default_model': record.model,
|
||||
'default_res_id': record.res_id,
|
||||
'default_parent_id': record.id },
|
||||
'options':{
|
||||
'thread': self.options.thread,
|
||||
'message': self.options.message
|
||||
},
|
||||
'parameters': message
|
||||
'parameters': record
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -1140,7 +1140,8 @@ openerp.mail = function(session) {
|
|||
// update context
|
||||
_.extend(this.options.context, {
|
||||
default_res_id: this.view.datarecord.id,
|
||||
default_model: this.view.model });
|
||||
default_model: this.view.model,
|
||||
default_is_private: false });
|
||||
// update domain
|
||||
var domain = this.options.domain.concat([['model', '=', this.view.model], ['res_id', '=', this.view.datarecord.id]]);
|
||||
// create and render Thread widget
|
||||
|
|
Loading…
Reference in New Issue