[IMP] mail_compose_message: added is_log boolean field for internal notes; + removed...
authorThibault Delavallée <tde@openerp.com>
Mon, 17 Mar 2014 12:24:09 +0000 (13:24 +0100)
committerThibault Delavallée <tde@openerp.com>
Mon, 17 Mar 2014 12:24:09 +0000 (13:24 +0100)
did the same thing. Fixed composer form view: internal note, only subject + body is
displayed.

bzr revid: tde@openerp.com-20140317122409-5fd5d5uwc35oq0hb

addons/mail/static/src/js/mail.js
addons/mail/wizard/mail_compose_message.py
addons/mail/wizard/mail_compose_message_view.xml

index 96236fd..e597e28 100644 (file)
@@ -512,13 +512,11 @@ openerp.mail = function (session) {
                     'default_body': mail.ChatterUtils.get_text2html(self.$el ? (self.$el.find('textarea:not(.oe_compact)').val() || '') : ''),
                     'default_attachment_ids': _.map(self.attachment_ids, function (file) {return file.id;}),
                     'default_partner_ids': partner_ids,
+                    'default_is_log': self.is_log,
                     'mail_post_autofollow': true,
                     'mail_post_autofollow_partner_ids': partner_ids,
                     'is_private': self.is_private
                 };
-                if (self.is_log) {
-                    _.extend(context, {'mail_compose_log': true});
-                }
                 if (default_composition_mode != 'reply' && self.context.default_model && self.context.default_res_id) {
                     context.default_model = self.context.default_model;
                     context.default_res_id = self.context.default_res_id;
index 7bdc344..5e235dd 100644 (file)
@@ -119,6 +119,8 @@ class mail_compose_message(osv.TransientModel):
         'attachment_ids': fields.many2many('ir.attachment',
             'mail_compose_message_ir_attachments_rel',
             'wizard_id', 'attachment_id', 'Attachments'),
+        'is_log': fields.boolean('Log an Internal Note',
+                                 help='Whether the message is an internal note (comment mode only)'),
         # mass mode options
         'notify': fields.boolean('Notify followers',
             help='Notify followers of the document (mass post only)'),
index 4c539e4..a2f723d 100644 (file)
@@ -11,6 +11,7 @@
                         <field name="composition_mode" invisible="1"/>
                         <field name="model" invisible="1"/>
                         <field name="res_id" invisible="1"/>
+                        <field name="is_log" invisible="1"/>
                         <field name="parent_id" invisible="1"/>
                         <field name="mail_server_id" invisible="1"/>
                         <!-- Various warnings -->
@@ -29,8 +30,8 @@
                             attrs="{'invisible':[('composition_mode', '!=', 'mass_mail')]}"/>
                         <field name="subject" placeholder="Subject..." required="True"/>
                         <!-- recipients -->
-                        <label for="partner_ids" string="Recipients" groups="base.group_user"/>
-                        <div groups="base.group_user">
+                        <label for="partner_ids" string="Recipients"  attrs="{'invisible': [('is_log', '=', True)]}" groups="base.group_user"/>
+                        <div groups="base.group_user" attrs="{'invisible': [('is_log', '=', True)]}">
                             <span attrs="{'invisible': [('composition_mode', '!=', 'mass_mail')]}">
                                 <strong>Email mass mailing</strong> on
                                 <span attrs="{'invisible': [('use_active_domain', '=', True)]}">the selected records</span>
                         <field name="notify"
                             attrs="{'invisible':['|', ('composition_mode', '!=', 'mass_post')]}"/>
                         <!-- mass mailing -->
-                        <label for="same_thread"/>
-                            <div>
-                                <field name="same_thread"
-                                    attrs="{'invisible':[('composition_mode', '!=', 'mass_mail')]}"/>
-                                (a copy of the message will be added in the Chatter of each document)
-                            </div>
+                        <field name="same_thread" attrs="{'invisible':[('composition_mode', '!=', 'mass_mail')]}"/>
                         <field name="reply_to" placeholder="Email address to redirect replies..."
                             attrs="{'invisible':['|', ('same_thread', '=', True), ('composition_mode', '!=', 'mass_mail')],
                                     'required':[('same_thread', '!=', True), ('composition_mode', '=', 'mass_mail')]}"/>