Turkesh Patel (openERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-social-crm_helpdesk-tpa into 
lp:~openerp-dev/openobject-addons/trunk-openchatter.

Requested reviews:
  OpenERP R&D Team (openerp-dev)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-social-crm_helpdesk-tpa/+merge/104225


                 crm_helpdesk
=============================================

[IMP]: improved code to add chatter and remove communication and history.
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-social-crm_helpdesk-tpa/+merge/104225
Your team OpenERP R&D Team is requested to review the proposed merge of 
lp:~openerp-dev/openobject-addons/trunk-social-crm_helpdesk-tpa into 
lp:~openerp-dev/openobject-addons/trunk-openchatter.
=== modified file 'crm_helpdesk/crm_helpdesk.py'
--- crm_helpdesk/crm_helpdesk.py	2012-03-06 12:38:08 +0000
+++ crm_helpdesk/crm_helpdesk.py	2012-05-01 10:25:26 +0000
@@ -92,6 +92,20 @@
         'priority': lambda *a: crm.AVAILABLE_PRIORITIES[2][0],
     }
 
+    def case_get_note_msg_prefix(self, cr, uid, id, context=None):
+        return 'Case'
+
+    def create(self, cr, uid, vals, context=None):
+        obj_id = super(crm_helpdesk, self).create(cr, uid, vals, context)
+        self.create_send_note(cr, uid, [obj_id], context=context)
+        return obj_id
+
+    def create_send_note(self, cr, uid, ids, context=None):
+        for id in ids:
+            msg = '%s has been <b>created</b>.' % (self.case_get_note_msg_prefix(cr, uid, id, context=context))
+            self.message_append_note(cr, uid, [id], body=msg, context=context)
+        return True
+
     def message_new(self, cr, uid, msg_dict, custom_values=None, context=None):
         """Automatically called when new email message arrives"""
         res_id = super(crm_helpdesk,self).message_new(cr, uid, msg_dict, custom_values=custom_values, context=context)

=== modified file 'crm_helpdesk/crm_helpdesk_view.xml'
--- crm_helpdesk/crm_helpdesk_view.xml	2012-04-25 11:51:39 +0000
+++ crm_helpdesk/crm_helpdesk_view.xml	2012-05-01 10:25:26 +0000
@@ -28,7 +28,8 @@
             <field name="model">crm.helpdesk</field>
             <field name="type">form</field>
             <field name="arch" type="xml">
-                <form string="Helpdesk Support">
+                <form string="Helpdesk Support" layout="manual">
+                <sheet layout="auto">
                     <group colspan="4" col="7">
                         <field name="name" select="1" string="Query"/>
                         <field name="section_id" widget="selection"/>
@@ -39,6 +40,9 @@
                             icon="gtk-go-forward" />
                         <field name="date" select="1"/>
                         <field name="date_deadline"/>
+                        <button string="Send New Email"
+                            name="%(mail.action_email_compose_message_wizard)d"
+                            icon="terp-mail-message-new" type="action"/>
                     </group>
                     <notebook colspan="4">
                         <page string="General">
@@ -89,29 +93,6 @@
                                     icon="gtk-convert" />
                             </group>
                         </page>
-                        <page string="Communication &amp; History">
-                            <group colspan="4">
-                                <field colspan="4" name="email_cc" string="Global CC" widget="char"/>
-                            </group>
-                            <field name="message_ids" colspan="4" nolabel="1" mode="tree" readonly="1">
-                                <tree string="History">
-                                    <field name="display_text" string="History Information"/>
-                                    <field name="email_from" invisible="1"/>
-                                    <button
-                                        string="Reply" attrs="{'invisible': [('email_from', '=', False)]}"
-                                        name="%(mail.action_email_compose_message_wizard)d"
-                                        context="{'mail.compose.message.mode':'reply', 'message_id':active_id}"
-                                        icon="terp-mail-replied" type="action" />
-                                </tree>
-                            </field>
-                             <button string="Add Internal Note"
-                                name="%(crm.action_crm_add_note)d"
-                                context="{'model': 'crm.lead' }"
-                                icon="terp-document-new" type="action" />
-                            <button string="Send New Email"
-                                name="%(mail.action_email_compose_message_wizard)d"
-                                icon="terp-mail-message-new" type="action"/>
-                        </page>
                         <page string="Extra Info">
                             <group colspan="2" col="2" groups="base.group_no_one">
                                 <separator colspan="4" string="Dates"/>
@@ -136,6 +117,10 @@
                             </group>
                         </page>
                     </notebook>
+                </sheet>
+                <div class="oe_form_sheet_width">
+                    <field name="message_ids_social" colspan="4" widget="ThreadView" nolabel="1"/>
+                </div>
                 </form>
             </field>
         </record>

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to