[IMP]: crm: Improvement in leads view to add history manually
authorrpa (Open ERP) <rpa@tinyerp.com>
Fri, 17 Sep 2010 12:47:21 +0000 (18:17 +0530)
committerrpa (Open ERP) <rpa@tinyerp.com>
Fri, 17 Sep 2010 12:47:21 +0000 (18:17 +0530)
bzr revid: rpa@tinyerp.com-20100917124721-w2f2muv6xlq3922s

addons/crm/crm_lead_view.xml
addons/mail_gateway/mail_gateway.py

index 221f043..9ca8834 100644 (file)
                     </group>
                  </page>
                  <page string="History" groups="base.group_extended">
-                   <group colspan="4">
-                       <field colspan="4" name="email_cc" string="Global CC" widget="char" size="512"/>
-                   </group>
-                    <field name="message_ids" colspan="4" nolabel="1" mode="tree,form">
-                        <tree string="Communication history">
+                    <group colspan="4">
+                        <field colspan="4" name="email_cc" string="Global CC" widget="char" size="512"/>
+                    </group>
+                    <field name="message_ids" colspan="4" nolabel="1" mode="tree,form" context="{'default_model': 'crm.lead', 'default_user_id': uid}" >
+                        <tree string="History">
                             <field name="display_text" string="History Information"/>
                             <field name="history" invisible="1"/>
-                            <button
-                                string="Reply" attrs="{'invisible': [('history', '!=', True)]}"
-                                name="%(crm.action_crm_send_mail)d"
-                                context="{'mail':'reply', 'model': 'crm.lead', 'include_original' : True}"
-                                icon="terp-mail-replied" type="action" />
+                            <button string="Reply" attrs="{'invisible': [('history', '!=', True)]}" name="123" context="{'mail':'reply', 'model': 'crm.lead', 'include_original' : True}" icon="terp-mail-replied" type="action"/>
                         </tree>
-                        <form string="Communication history">
-                            <group col="4" colspan="4">
-                                <field name="email_from"/>
-                                <field name="date"/>
-                                <field name="email_to" widget="char" size="512"/>
-                                <field name="email_cc" widget="char" size="512"/>
-                                <field name="name" colspan="4" widget="char" size="512"/>
-                                <field name="history" invisible="1"/>
-                            </group>
+                        <form string="History">
+                            <field name="history"/>
+                            <field name="name" colspan="4" widget="char" size="512" required="1"/>
+                            <field name="date" required="1"/>
+                            <field name="user_id"/>
+                            <field name="model" invisible="1"/>
                             <notebook colspan="4">
                                 <page string="Details">
-                                    <group attrs="{'invisible': [('history', '!=', True)]}">
-                                        <field name="description" colspan="4" nolabel="1" height="250"/>
-                                        <button colspan="4"
-                                            string="Reply"
-                                            name="%(crm.action_crm_send_mail)d"
-                                            context="{'mail':'reply', 'model': 'crm.lead', 'include_original' : True}"
-                                            icon="terp-mail-replied" type="action" />
+                                    <group col="4" colspan="4" attrs="{'invisible': [('history', '!=', True)]}">
+                                        <field name="email_from" attrs="{'required': [('history', '=', True)]}"/>
+                                        <field name="email_to" widget="char" size="512"  attrs="{'required': [('history', '=', True)]}"/>
+                                        <field name="email_cc" widget="char" size="512"/>
+                                    </group>
+                                    <separator string="Description" colspan="4"/>
+                                     <group colspan="4" attrs="{'invisible': [('history', '!=', True)]}">
+                                        <field name="description" colspan="4" nolabel="1" attrs="{'required': [('history', '=', True)]}"/>
                                     </group>
-                                    <group attrs="{'invisible': [('history', '=', True)]}">
-                                        <field name="display_text" colspan="4" nolabel="1"  height="250"/>
+                                    <group colspan="4" attrs="{'invisible': [('history', '=', True)]}">
+                                        <field name="display_text" colspan="4" nolabel="1"/>
                                     </group>
+                                    <button colspan="4" string="Reply" name="123" context="{'mail':'reply', 'model': 'crm.lead', 'include_original' : True}" icon="terp-mail-replied" type="action"/>
                                 </page>
                                 <page string="Attachments">
                                     <field name="attachment_ids" colspan="4" readonly="1" nolabel="1"/>
index c8d75a3..98a0356 100644 (file)
@@ -214,23 +214,23 @@ class mailgate_message(osv.osv):
     _description = 'Mailgateway Message'
     _order = 'date desc'
     _columns = {
-        'name':fields.text('Subject', readonly=True),
-        'model': fields.char('Object Name', size=128, select=1, readonly=True),
-        'res_id': fields.integer('Resource ID', select=1, readonly=True),
-        'ref_id': fields.char('Reference Id', size=256, readonly=True, help="Message Id in Email Server.", select=True),
-        'date': fields.datetime('Date', readonly=True),
-        'history': fields.boolean('Is History?', readonly=True),
-        'user_id': fields.many2one('res.users', 'User Responsible', readonly=True),
-        'message': fields.text('Description', readonly=True),
-        'email_from': fields.char('From', size=128, help="Email From", readonly=True),
-        'email_to': fields.char('To', help="Email Recipients", size=256, readonly=True),
-        'email_cc': fields.char('Cc', help="Carbon Copy Email Recipients", size=256, readonly=True),
-        'email_bcc': fields.char('Bcc', help='Blind Carbon Copy Email Recipients', size=256, readonly=True),
-        'message_id': fields.char('Message Id', size=1024, readonly=True, help="Message Id on Email.", select=True),
-        'references': fields.text('References', readonly=True, help="References emails."),
-        'description': fields.text('Description', readonly=True),
+        'name':fields.text('Subject'),
+        'model': fields.char('Object Name', size=128, select=1),
+        'res_id': fields.integer('Resource ID', select=1),
+        'ref_id': fields.char('Reference Id', size=256, help="Message Id in Email Server.", select=True),
+        'date': fields.datetime('Date'),
+        'history': fields.boolean('Is History?'),
+        'user_id': fields.many2one('res.users', 'User Responsible'),
+        'message': fields.text('Description'),
+        'email_from': fields.char('From', size=128, help="Email From"),
+        'email_to': fields.char('To', help="Email Recipients", size=256),
+        'email_cc': fields.char('Cc', help="Carbon Copy Email Recipients", size=256),
+        'email_bcc': fields.char('Bcc', help='Blind Carbon Copy Email Recipients', size=256),
+        'message_id': fields.char('Message Id', size=1024, help="Message Id on Email.", select=True),
+        'references': fields.text('References', help="References emails."),
+        'description': fields.text('Description'),
         'partner_id': fields.many2one('res.partner', 'Partner', required=False),
-        'attachment_ids': fields.many2many('ir.attachment', 'message_attachment_rel', 'message_id', 'attachment_id', 'Attachments', readonly=True),
+        'attachment_ids': fields.many2many('ir.attachment', 'message_attachment_rel', 'message_id', 'attachment_id', 'Attachments'),
         'display_text': fields.function(_get_display_text, method=True, type='text', size="512", string='Display Text'),
     }