← Back to team overview

openerp-dev-web team mailing list archive

lp:~openerp-dev/openobject-addons/trunk-openerp_crm_imp-phonecalls_stages-rme into lp:~openerp-dev/openobject-addons/trunk-trunk-crm-imp-final

 

tfr (Openerp) has proposed merging lp:~openerp-dev/openobject-addons/trunk-openerp_crm_imp-phonecalls_stages-rme into lp:~openerp-dev/openobject-addons/trunk-trunk-crm-imp-final.

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

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-openerp_crm_imp-phonecalls_stages-rme/+merge/57181
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-openerp_crm_imp-phonecalls_stages-rme/+merge/57181
Your team OpenERP R&D Team is requested to review the proposed merge of lp:~openerp-dev/openobject-addons/trunk-openerp_crm_imp-phonecalls_stages-rme into lp:~openerp-dev/openobject-addons/trunk-trunk-crm-imp-final.
=== modified file 'crm/crm.py'
--- crm/crm.py	2011-03-04 12:53:34 +0000
+++ crm/crm.py	2011-04-11 14:56:38 +0000
@@ -570,7 +570,7 @@
         'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of case stages."),
         'probability': fields.float('Probability (%)', required=True, help="This percentage depicts the default/average probability of the Case for this stage to be a success"),
         'on_change': fields.boolean('Change Probability Automatically', \
-                         help="Change Probability on next and previous stages."),
+                         help="If checked, OpenERP will set the probability of the opportunity to the probability defined in the stage. If you set a probability of 0%/100% on check the 'Change Probability Automatically' field, OpenERP will assign this stage when the opportunity is marked as Lost/Won."),
         'requirements': fields.text('Requirements'),
         'type': fields.selection(_get_type_value, 'Type', required=True),
     }
@@ -725,9 +725,14 @@
     _name = "crm.case.resource.type"
     _description = "Campaign"
     _rec_name = "name"
+    
+    def _get_resource_type_value(self, cr, user, context=None):
+        return [('crm_case','Lead / Opportunity')]
+
     _columns = {
         'name': fields.char('Campaign Name', size=64, required=True, translate=True),
         'section_id': fields.many2one('crm.case.section', 'Sales Team'),
+        'type': fields.selection(_get_resource_type_value, 'Type')
     }
 crm_case_resource_type()
 

=== modified file 'crm/crm_lead_data.xml'
--- crm/crm_lead_data.xml	2011-01-14 00:11:01 +0000
+++ crm/crm_lead_data.xml	2011-04-11 14:56:38 +0000
@@ -57,41 +57,49 @@
         <record model="crm.case.resource.type" id="type_lead1">
             <field name="name">Telesales</field>
             <field name="section_id" ref="section_sales_department"/>
+            <field name="type">crm_case</field>
         </record>
 
         <record model="crm.case.resource.type" id="type_lead2">
             <field name="name">Mail Campaign 1</field>
             <field name="section_id" ref="section_sales_department"/>
+            <field name="type">crm_case</field>
         </record>
 
         <record model="crm.case.resource.type" id="type_lead3">
             <field name="name">Mail Campaign 2</field>
             <field name="section_id" ref="section_sales_department"/>
+            <field name="type">crm_case</field>
         </record>
 
         <record model="crm.case.resource.type" id="type_lead4">
             <field name="name">Twitter Ads</field>
             <field name="section_id" ref="section_sales_department"/>
+            <field name="type">crm_case</field>
         </record>
 
         <record model="crm.case.resource.type" id="type_lead5">
             <field name="name">Google Adwords</field>
             <field name="section_id" ref="section_sales_department"/>
+            <field name="type">crm_case</field>
         </record>
 
         <record model="crm.case.resource.type" id="type_lead6">
             <field name="name">Google Adwords 2</field>
             <field name="section_id" ref="section_sales_department"/>
+            <field name="type">crm_case</field>
         </record>
 
         <record model="crm.case.resource.type" id="type_lead7">
             <field name="name">Television</field>
             <field name="section_id" ref="section_sales_department"/>
+            <field name="type">crm_case</field>
         </record>
 
         <record model="crm.case.resource.type" id="type_lead8">
             <field name="name">Newsletter</field>
             <field name="section_id" ref="section_sales_department"/>
+            <field name="type">crm_case</field>
         </record>
 
     </data>

=== modified file 'crm/crm_lead_view.xml'
--- crm/crm_lead_view.xml	2011-04-07 09:27:30 +0000
+++ crm/crm_lead_view.xml	2011-04-11 14:56:38 +0000
@@ -71,19 +71,16 @@
                          string="Convert to Opportunity"
                          help="Convert to Opportunity" icon="gtk-go-forward"
                          type="object"/>
-                    <newline />
+                    <newline/>
                     <field name="user_id" />
                     <field name="section_id" widget="selection" />
-                    <field name="stage_id" domain="[('type','=','lead'),('section_ids', '=', section_id)]" />
-                    <group col="2" colspan="1">
-                        <button name="stage_previous" string=""
-                            states="open,pending,draft" type="object"
-                            icon="gtk-go-back" context="{'stage_type': 'lead'}" />
-                        <button name="stage_next" string=""
-                            states="open,pending,draft" type="object"
-                            icon="gtk-go-forward" context="{'stage_type': 'lead'}" />
-                    </group>
                     <field name="type" invisible="1"/>
+                    <label string="" colspan="2"/>
+                    <button 
+                    	string="Schedule/Log Call"
+                        name="%(opportunity2phonecall_act)d" 
+                        icon="terp-call-start" 
+                        type="action"/>
                 </group>
                 <notebook colspan="4">
                 <page string="Lead">
@@ -156,7 +153,7 @@
                         <field name="company_id"
                             groups="base.group_multi_company"
                             widget="selection" colspan="2" />
-                        <field name="type_id" select="1" widget="selection"/>
+                        <field name="type_id" select="1" widget="selection" domain="[('type','=','crm_case')]"/>
                         <field name="channel_id" select="1" widget="selection"/>
                         <field name="referred"/>
                     </group>

=== modified file 'crm/crm_opportunity_data.xml'
--- crm/crm_opportunity_data.xml	2011-01-14 00:11:01 +0000
+++ crm/crm_opportunity_data.xml	2011-04-11 14:56:38 +0000
@@ -99,10 +99,12 @@
 	    <record model="crm.case.resource.type" id="type_oppor1">
 	        <field name="name">Campaign 2</field>
 	        <field name="section_id" ref="section_sales_department"/>
+	        <field name="type">crm_case</field>
 	    </record>
 	    <record model="crm.case.resource.type" id="type_oppor2">
 	        <field name="name">Campaign 1</field>
 	        <field name="section_id" ref="section_sales_department"/>
+	        <field name="type">crm_case</field>
 	    </record>
 
 </data>

=== modified file 'crm/crm_opportunity_view.xml'
--- crm/crm_opportunity_view.xml	2011-04-07 09:27:30 +0000
+++ crm/crm_opportunity_view.xml	2011-04-11 14:56:38 +0000
@@ -126,7 +126,7 @@
                             </group>
                             <group colspan="2" col="2">
                                 <separator string="Categorization" colspan="2"/>
-                                <field name="type_id" widget="selection" groups="base.group_extended"/>
+                                <field name="type_id" widget="selection" groups="base.group_extended" domain="[('type','=','crm_case')]"/>
                                 <field name="channel_id" widget="selection"/>
                             </group>
                             <group colspan="2" col="2">

=== modified file 'crm/crm_phonecall.py'
--- crm/crm_phonecall.py	2011-01-31 13:29:31 +0000
+++ crm/crm_phonecall.py	2011-04-11 14:56:38 +0000
@@ -53,13 +53,13 @@
                                     ('draft', 'Draft'), 
                                     ('open', 'Todo'), 
                                     ('cancel', 'Cancelled'), 
-                                    ('done', 'Done'), 
-                                    ('pending', 'Pending'),
+                                    ('done', 'Called Log'), 
+                                    ('pending', 'Schedule Call'),
                                 ], 'State', size=16, readonly=True, 
                                   help='The state is set to \'Draft\', when a case is created.\
                                   \nIf the case is in progress the state is set to \'Open\'.\
-                                  \nWhen the case is over, the state is set to \'Done\'.\
-                                  \nIf the case needs to be reviewed then the state is set to \'Pending\'.'), 
+                                  \nWhen the case is over, the state is set to \'Called Log\'.\
+                                  \nIf the case needs to be reviewed then the state is set to \'Schedule\'.'), 
         'email_from': fields.char('Email', size=128, help="These people will receive email."), 
         'date_open': fields.datetime('Opened', readonly=True),
         # phonecall fields
@@ -81,6 +81,7 @@
         'date': fields.datetime('Date'), 
         'opportunity_id': fields.many2one ('crm.lead', 'Opportunity'), 
         'message_ids': fields.one2many('mailgate.message', 'res_id', 'Messages', domain=[('model','=',_name)]),
+        'category': fields.char('Category', size=128),
     }
 
     _defaults = {
@@ -101,6 +102,13 @@
             res['value']['partner_phone'] = address.phone
             res['value']['partner_mobile'] = address.mobile
         return res
+    
+    def onchange_categ_id(self, cr, uid, ids, categ_id):
+        v={}
+        if categ_id:
+            categ = self.pool.get('crm.case.categ').browse(cr, uid, categ_id)
+            v['category']=categ.name
+        return {'value': v}
 
     def case_close(self, cr, uid, ids, *args):
         """Overrides close for crm_case for setting close date
@@ -113,9 +121,14 @@
         for phone in self.browse(cr, uid, ids):
             phone_id= phone.id
             data = {'date_closed': time.strftime('%Y-%m-%d %H:%M:%S')}
+            phone_type_obj = self.pool.get('crm.case.categ')
+            phone_type_ids = phone_type_obj.search(cr, uid, [('name', '=', 'Log A Call')], limit=1)
+            if not phone_type_ids:
+                raise osv.except_osv(_('Error !'),
+                    _('There is no phonecall type/category "Log A Call" defined'))
             if phone.duration <=0:
                 duration = datetime.now() - datetime.strptime(phone.date, '%Y-%m-%d %H:%M:%S')
-                data.update({'duration': duration.seconds/float(60)})
+                data.update({'duration': duration.seconds/float(60), 'categ_id':phone_type_ids[0]})
             res = super(crm_phonecall, self).case_close(cr, uid, [phone_id], args)
             self.write(cr, uid, ids, data)
         return res
@@ -145,6 +158,23 @@
         self.write(cr, uid, ids, {'date_open': time.strftime('%Y-%m-%d %H:%M:%S')})
         return res
 
+    def case_pending(self, cr, uid, ids, *args):
+        """Marks case as pending
+        @param self: The object pointer
+        @param cr: the current row, from the database cursor,
+        @param uid: the current user’s ID for security checks,
+        @param ids: List of case Ids
+        @param *args: Tuple Value for additional Params
+        """
+        phone_type_obj = self.pool.get('crm.case.categ')
+        res = super(crm_phonecall, self).case_pending(cr, uid, ids, args)
+        phone_type_ids = phone_type_obj.search(cr, uid, [('name', '=', 'Schedule Call')], limit=1)
+        if not phone_type_ids:
+            raise osv.except_osv(_('Error !'),
+                _('There is no phonecall type/category "Schedule Call" defined'))
+        self.pool.get('crm.phonecall').write(cr, uid, ids,{'categ_id':phone_type_ids[0], 'state' : 'pending'})
+        return res
+    
     def action_make_meeting(self, cr, uid, ids, context=None):
         """
         This opens Meeting's calendar view to schedule meeting on current Phonecall

=== modified file 'crm/crm_phonecall_data.xml'
--- crm/crm_phonecall_data.xml	2011-01-14 00:11:01 +0000
+++ crm/crm_phonecall_data.xml	2011-04-11 14:56:38 +0000
@@ -5,13 +5,13 @@
     Phonecall Categories
     -->
     <record model="crm.case.categ" id="categ_phone1">
-        <field name="name">Inbound</field>
+        <field name="name">Log A Call</field>
         <field name="section_id" ref="section_sales_department"/>
         <field name="object_id" search="[('model','=','crm.phonecall')]" model="ir.model"/>
 
     </record>
     <record model="crm.case.categ" id="categ_phone2">
-        <field name="name">Outbound</field>
+        <field name="name">Schedule Call</field>
         <field name="section_id" ref="section_sales_department"/>
         <field name="object_id" search="[('model','=','crm.phonecall')]" model="ir.model"/>
     </record>

=== modified file 'crm/crm_phonecall_menu.xml'
--- crm/crm_phonecall_menu.xml	2011-01-27 09:49:39 +0000
+++ crm/crm_phonecall_menu.xml	2011-04-11 14:56:38 +0000
@@ -60,54 +60,15 @@
         groups="base.group_extended,base.group_sale_salesman"
         parent="base.menu_base_partner" sequence="4" />
 
-    <record model="ir.actions.act_window" id="crm_case_categ_phone_incoming0">
-        <field name="name">Inbound</field>
-        <field name="res_model">crm.phonecall</field>
-        <field name="view_type">form</field>
-        <field name="view_mode">tree,calendar</field>
-        <field name="view_id" ref="crm_case_phone_tree_view"/>
-        <field name="domain" eval="'[(\'categ_id\',\'=\','+str(ref('categ_phone1'))+')]'"/>
-        <field name="context" eval="'{\'search_default_section_id\':section_id, \'default_state\':\'open\', \'search_default_current\':1,\'search_default_today\':1, \'default_categ_id\': ' + str(ref('categ_phone1')) +'}'"/>
-        <field name="search_view_id" ref="crm.view_crm_case_phonecalls_filter"/>
-        <field name="help">The Inbound Calls tool allows you to log your inbound calls on the fly. Each call you get will appear on the partner form to trace every contact you have with a partner. From the phone call form, you can trigger a request for another call, a meeting or an opportunity.</field>
-
-    </record>
-
-    <record model="ir.actions.act_window.view" id="action_crm_tag_tree_phone_incoming0">
-        <field name="sequence" eval="1"/>
-        <field name="view_mode">tree</field>
-        <field name="view_id" ref="crm_case_inbound_phone_tree_view"/>
-        <field name="act_window_id" ref="crm_case_categ_phone_incoming0"/>
-    </record>
-
-    <record model="ir.actions.act_window.view" id="action_crm_tag_calendar_phone_incoming0">
-        <field name="sequence" eval="2"/>
-        <field name="view_mode">calendar</field>
-        <field name="view_id" ref="crm_case_phone_calendar_view"/>
-        <field name="act_window_id" ref="crm_case_categ_phone_incoming0"/>
-    </record>
-
-    <record model="ir.actions.act_window.view" id="action_crm_tag_form_phone_incoming0">
-        <field name="sequence" eval="3"/>
-        <field name="view_mode">form</field>
-        <field name="view_id" ref="crm_case_inbound_phone_form_view"/>
-        <field name="act_window_id" ref="crm_case_categ_phone_incoming0"/>
-    </record>
-
-    <menuitem name="Inbound" id="menu_crm_case_phone_inbound"
-        parent="crm.menu_crm_case_phone"
-        action="crm_case_categ_phone_incoming0" />
-
     <record model="ir.actions.act_window" id="crm_case_categ_phone_outgoing0">
-        <field name="name">Outbound</field>
+        <field name="name">Phone Calls</field>
         <field name="res_model">crm.phonecall</field>
         <field name="view_type">form</field>
         <field name="view_mode">tree,calendar</field>
         <field name="view_id" ref="crm_case_phone_tree_view"/>
-        <field name="domain" eval="'[(\'categ_id\',\'=\','+str(ref('categ_phone2'))+')]'"/>
         <field name="context" eval="'{\'search_default_section_id\':section_id, \'default_state\':\'open\', \'search_default_current\':1, \'default_categ_id\': ' + str(ref('categ_phone2')) +'}'"/>
         <field name="search_view_id" ref="crm.view_crm_case_phonecalls_filter"/>
-        <field name="help">Outbound Calls list all the calls to be done by your sales team. A salesman can record the information about the call in the form view. This information will be stored in the partner form to trace every contact you have with a customer. You can also import a .CSV file with a list of calls to be done by your sales team.</field>
+        <field name="help">Phone Calls list all the calls to be done by your sales team. A salesman can record the information about the call in the form view. This information will be stored in the partner form to trace every contact you have with a customer. You can also import a .CSV file with a list of calls to be done by your sales team.</field>
     </record>
 
     <record model="ir.actions.act_window.view" id="action_crm_tag_tree_phone_outgoing0">
@@ -131,7 +92,7 @@
         <field name="act_window_id" ref="crm_case_categ_phone_outgoing0"/>
     </record>
 
-    <menuitem name="Outbound" id="menu_crm_case_phone_outbound"
+    <menuitem name="Phone Calls" id="menu_crm_case_phone_outbound"
         parent="crm.menu_crm_case_phone"
         action="crm_case_categ_phone_outgoing0" />
 

=== modified file 'crm/crm_phonecall_view.xml'
--- crm/crm_phonecall_view.xml	2011-01-17 22:22:19 +0000
+++ crm/crm_phonecall_view.xml	2011-04-11 14:56:38 +0000
@@ -61,9 +61,10 @@
                  <group colspan="6" col="7">
                     <field name="name" required="1"/>
                     <field name="partner_phone"/>
-                    <field name="duration" widget="float_time" required="1"/>
+                    <field name="category" invisible="1"/>
+                    <field name="duration" widget="float_time"
+                    attrs="{'required':['|',('category', '=', 'Schedule Call'),('state', '=', 'pending'),('state', '!=', 'done')]}" />
                     <button string="Schedule a Meeting" name="action_make_meeting" icon="gtk-redo" type="object"/>
-
                     <field name="date" required="1"/>
                     <field name="user_id"/>
                     <field name="section_id" colspan="1" widget="selection" />
@@ -98,6 +99,7 @@
                 <group col="2" colspan="2">
                     <separator colspan="2" string="Categorization" />
                     <field name="categ_id" widget="selection"
+                    	on_change="onchange_categ_id(categ_id)"
                         domain="[('object_id.model', '=', 'crm.phonecall')]"
                         string="Type" />
                     <field name="priority"/>
@@ -127,105 +129,6 @@
         </field>
     </record>
 
-    <!--Inbound Phonecalls Form View -->
-
-    <record model="ir.ui.view" id="crm_case_inbound_phone_form_view">
-        <field name="name">CRM - Inbound Phone Call Form</field>
-        <field name="model">crm.phonecall</field>
-        <field name="type">form</field>
-        <field name="arch" type="xml">
-            <form string="Phone Call">
-                <group colspan="4" col="7">
-                    <field name="name" required="1"/>
-                    <field name="partner_phone"/>
-                    <field name="duration" widget="float_time"/>
-                    <button string="Schedule a Meeting"
-                        name="action_make_meeting"
-                        icon="gtk-redo"
-                        type="object" />
-
-                    <field name="date" required="1"/>
-                    <field name="user_id"/>
-                    <field name="section_id" colspan="1" widget="selection" />
-                    <button string="Convert to Opportunity"
-                        name="%(phonecall2opportunity_act)d"
-                        icon="gtk-index" type="action"
-                        attrs="{'invisible':[('opportunity_id','!=',False)]}" />
-                    <label colspan="6"  string=""/>
-                    <button string="Schedule Other Call"
-                     icon="terp-call-start"
-                    name="%(phonecall_to_phonecall_act)d"
-                    type="action"  />
-
-                </group>
-                <group col="3" colspan="2">
-                    <separator colspan="3" string="Contacts" />
-                    <field name="partner_id"
-                        on_change="onchange_partner_id(partner_id, email_from)" />
-                    <button string="Create a Partner"
-                        icon="terp-partner"
-                        name="%(action_crm_phonecall2partner)d"
-                        type="action"
-                        attrs="{'invisible':[('partner_id','!=',False)]}"
-                        groups="base.group_partner_manager" />
-                    <newline/>
-                    <field name="partner_address_id"
-                        on_change="onchange_partner_address_id(partner_address_id, email_from)" />
-                    <newline/>
-                    <field name="partner_mobile" />
-                </group>
-                <group col="2" colspan="2">
-                    <separator colspan="2" string="Categorization" />
-                    <field name="categ_id" widget="selection"
-                        domain="[('object_id.model', '=', 'crm.phonecall')]"
-                        string="Type" />
-                    <field name="priority"/>
-                    <field name="opportunity_id"/>
-                </group>
-                <separator string="Description" colspan="4" />
-                <field name="description" nolabel="1" colspan="4" />
-                <separator colspan="4" />
-            </form>
-        </field>
-    </record>
-
-    <!--Inbound Phonecalls Tree View -->
-
-    <record model="ir.ui.view" id="crm_case_inbound_phone_tree_view">
-        <field name="name">CRM - Inbound Phone Calls Tree</field>
-        <field name="model">crm.phonecall</field>
-        <field name="type">tree</field>
-        <field name="arch" type="xml">
-            <tree string="Phone Calls" colors="grey:state in ('cancel','done');blue:state in ('pending',)" editable="top">
-                <field name="date"/>
-                <field name="name"/>
-                <field name="partner_id"
-                    on_change="onchange_partner_id(partner_id)"
-                    string="Partner" />
-                <field name="partner_address_id"
-                        on_change="onchange_partner_address_id(partner_address_id)" />
-                <field name="partner_phone"/>
-                <field name="user_id"/>
-                <field name="categ_id" widget="selection"
-                    domain="[('object_id.model', '=', 'crm.phonecall')]"
-                    string="Type" />
-                <field name="state" invisible="1"/>
-                <field name="create_date" invisible="1"/>
-                <button string="Schedule Other Call"
-                    icon="terp-call-start"
-                    name="%(phonecall_to_phonecall_act)d"
-                    type="action"  />
-                <button string="Convert to Opportunity"
-                    name="%(phonecall2opportunity_act)d"
-                    states="draft,open,pending"
-                    icon="gtk-index"
-                    type="action" attrs="{'invisible':[('opportunity_id','!=',False)]}" />
-                <button string="Meeting"
-                    states="draft,open,pending" icon="gtk-redo"
-                     name="action_make_meeting" type="object" />
-            </tree>
-        </field>
-    </record>
 
 <!-- Phonecalls Calendar View -->
 
@@ -290,6 +193,8 @@
                        domain="[]" context="{'group_by':'create_date'}" />
                    <filter string="Date" icon="terp-go-month" domain="[]"
                        context="{'group_by':'date'}" help="Date of Call" />
+                   <filter string="Type" icon="terp-stock_symbol-selection" domain="[]"
+                       context="{'group_by':'categ_id'}" />
                </group>
            </search>
         </field>

=== modified file 'crm/crm_view.xml'
--- crm/crm_view.xml	2011-02-18 04:33:13 +0000
+++ crm/crm_view.xml	2011-04-11 14:56:38 +0000
@@ -187,6 +187,7 @@
                 <tree string="Campaign">
                     <field name="name"/>
                     <field name="section_id"/>
+                    <field name="type"/>
                 </tree>
             </field>
         </record>
@@ -201,6 +202,7 @@
                 <form string="Campaign">
                     <field name="name" select="1"/>
                     <field name="section_id" select="1" widget="selection"/>
+                    <field name="type"/>
                 </form>
             </field>
         </record>

=== modified file 'crm/wizard/crm_merge_opportunities.py'
--- crm/wizard/crm_merge_opportunities.py	2011-04-11 08:51:20 +0000
+++ crm/wizard/crm_merge_opportunities.py	2011-04-11 14:56:38 +0000
@@ -30,7 +30,7 @@
     def _get_first_not_null_id(self, attr, ops, oldest):
         if hasattr(oldest, attr) and getattr(oldest, attr):
             return getattr(oldest, attr).id
-        
+
         for op in ops:
             if hasattr(op, attr) and getattr(op, attr):
                 return getattr(op, attr).id
@@ -39,7 +39,7 @@
     def _get_first_not_null(self, attr, ops, oldest):
         if hasattr(oldest, attr) and getattr(oldest, attr):
             return getattr(oldest, attr)
-        
+
         for op in ops:
             if hasattr(op, attr) and getattr(op, attr):
                 return getattr(op, attr)
@@ -92,7 +92,7 @@
         else:
             first_opportunity = opportunities_list[0]
             tail_opportunities = opportunities_list[1:]
-            
+
 
         data = {
                 'partner_id': self._get_first_not_null_id('partner_id', op_ids, oldest_opp),  # !!
@@ -132,9 +132,9 @@
                 'partner_name' : self._get_first_not_null('partner_name', op_ids, oldest_opp),
 
             }
-        
+
         #copy message into the first opportunity + merge attachement
-        
+
         for opp in tail_opportunities + [first_opportunity]:
             attach_ids = self.get_attachments(cr, uid, opp, context=context)
             self.set_attachements_res_id(cr, uid, first_opportunity.id, attach_ids)

=== modified file 'crm_claim/crm_claim.py'
--- crm_claim/crm_claim.py	2011-03-16 12:38:21 +0000
+++ crm_claim/crm_claim.py	2011-04-11 14:56:38 +0000
@@ -41,47 +41,47 @@
     _order = "priority,date desc"
     _inherit = ['mailgate.thread']
     _columns = {
-        'id': fields.integer('ID', readonly=True), 
-        'name': fields.char('Claim Subject', size=128, required=True), 
+        'id': fields.integer('ID', readonly=True),
+        'name': fields.char('Claim Subject', size=128, required=True),
         'action_next': fields.char('Next Action', size=200),
         'date_action_next': fields.datetime('Next Action Date'),
-        'description': fields.text('Description'), 
-        'resolution': fields.text('Resolution'), 
-        'create_date': fields.datetime('Creation Date' , readonly=True), 
-        'write_date': fields.datetime('Update Date' , readonly=True), 
-        'date_deadline': fields.date('Deadline'), 
-        'date_closed': fields.datetime('Closed', readonly=True), 
-        'date': fields.datetime('Claim Date'), 
-        'ref' : fields.reference('Reference', selection=crm._links_get, size=128), 
+        'description': fields.text('Description'),
+        'resolution': fields.text('Resolution'),
+        'create_date': fields.datetime('Creation Date' , readonly=True),
+        'write_date': fields.datetime('Update Date' , readonly=True),
+        'date_deadline': fields.date('Deadline'),
+        'date_closed': fields.datetime('Closed', readonly=True),
+        'date': fields.datetime('Claim Date'),
+        'ref' : fields.reference('Reference', selection=crm._links_get, size=128),
         'categ_id': fields.many2one('crm.case.categ', 'Category', \
                             domain="[('section_id','=',section_id),\
-                            ('object_id.model', '=', 'crm.claim')]"), 
-        'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority'), 
+                            ('object_id.model', '=', 'crm.claim')]"),
+        'priority': fields.selection(crm.AVAILABLE_PRIORITIES, 'Priority'),
         'type_action': fields.selection([('correction','Corrective Action'),('prevention','Preventive Action')], 'Action Type'),
-        'user_id': fields.many2one('res.users', 'Responsible'), 
-        'user_fault': fields.char('Trouble Responsible', size=64), 
+        'user_id': fields.many2one('res.users', 'Responsible'),
+        'user_fault': fields.char('Trouble Responsible', size=64),
         'section_id': fields.many2one('crm.case.section', 'Sales Team', \
                         select=True, help="Sales team to which Case belongs to."\
                                 "Define Responsible user and Email account for"\
-                                " mail gateway."), 
-        'company_id': fields.many2one('res.company', 'Company'), 
-        'partner_id': fields.many2one('res.partner', 'Partner'), 
+                                " mail gateway."),
+        'company_id': fields.many2one('res.company', 'Company'),
+        'partner_id': fields.many2one('res.partner', 'Partner'),
         'partner_address_id': fields.many2one('res.partner.address', 'Partner Contact', \
                                 # domain="[('partner_id','=',partner_id)]"
-                                 ), 
-        'email_cc': fields.text('Watchers Emails', size=252, help="These email addresses will be added to the CC field of all inbound and outbound emails for this record before being sent. Separate multiple email addresses with a comma"), 
-        'email_from': fields.char('Email', size=128, help="These people will receive email."), 
-        'partner_phone': fields.char('Phone', size=32), 
-        'stage_id': fields.many2one ('crm.case.stage', 'Stage', domain="[('type','=','claim')]"), 
-        'cause': fields.text('Root Cause'), 
-        'state': fields.selection(crm.AVAILABLE_STATES, 'State', size=16, readonly=True, 
+                                 ),
+        'email_cc': fields.text('Watchers Emails', size=252, help="These email addresses will be added to the CC field of all inbound and outbound emails for this record before being sent. Separate multiple email addresses with a comma"),
+        'email_from': fields.char('Email', size=128, help="These people will receive email."),
+        'partner_phone': fields.char('Phone', size=32),
+        'stage_id': fields.many2one ('crm.case.stage', 'Stage', domain="[('type','=','claim')]"),
+        'cause': fields.text('Root Cause'),
+        'state': fields.selection(crm.AVAILABLE_STATES, 'State', size=16, readonly=True,
                                   help='The state is set to \'Draft\', when a case is created.\
                                   \nIf the case is in progress the state is set to \'Open\'.\
                                   \nWhen the case is over, the state is set to \'Done\'.\
-                                  \nIf the case needs to be reviewed then the state is set to \'Pending\'.'), 
+                                  \nIf the case needs to be reviewed then the state is set to \'Pending\'.'),
         'message_ids': fields.one2many('mailgate.message', 'res_id', 'Messages', domain=[('model','=',_name)]),
     }
-    
+
     def stage_next(self, cr, uid, ids, context=None):
         stage = super(crm_claim, self).stage_next(cr, uid, ids, context=context)
         if stage:
@@ -95,7 +95,7 @@
             stage_obj = self.pool.get('crm.case.stage').browse(cr, uid, stage, context=context)
             self.history(cr, uid, ids, _("Changed Stage to: ") + stage_obj.name)
         return stage
-    
+
     def _get_stage_id(self, cr, uid, context=None):
         """Finds type of stage according to object.
         @param self: The object pointer
@@ -110,18 +110,18 @@
         return stage_ids and stage_ids[0] or False
 
     _defaults = {
-        'user_id': crm.crm_case._get_default_user, 
-        'partner_id': crm.crm_case._get_default_partner, 
-        'partner_address_id': crm.crm_case._get_default_partner_address, 
-        'email_from':crm.crm_case. _get_default_email, 
-        'state': lambda *a: 'draft', 
-        'section_id':crm.crm_case. _get_section, 
+        'user_id': crm.crm_case._get_default_user,
+        'partner_id': crm.crm_case._get_default_partner,
+        'partner_address_id': crm.crm_case._get_default_partner_address,
+        'email_from':crm.crm_case. _get_default_email,
+        'state': lambda *a: 'draft',
+        'section_id':crm.crm_case. _get_section,
         'date': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'),
-        'company_id': lambda s, cr, uid, c: s.pool.get('res.company')._company_default_get(cr, uid, 'crm.case', context=c), 
+        'company_id': lambda s, cr, uid, c: s.pool.get('res.company')._company_default_get(cr, uid, 'crm.case', context=c),
         'priority': lambda *a: crm.AVAILABLE_PRIORITIES[2][0],
-        #'stage_id': _get_stage_id, 
+        #'stage_id': _get_stage_id,
     }
-    
+
     def onchange_partner_id(self, cr, uid, ids, part, email=False):
         """This function returns value of partner address based on partner
         @param self: The object pointer
@@ -133,7 +133,7 @@
         """
         if not part:
             return {'value': {'partner_address_id': False,
-                            'email_from': False, 
+                            'email_from': False,
                             'partner_phone': False,
                             'partner_mobile': False
                             }}
@@ -155,21 +155,21 @@
             return {'value': {'email_from': False}}
         address = self.pool.get('res.partner.address').browse(cr, uid, add)
         return {'value': {'email_from': address.email, 'partner_phone': address.phone, 'partner_mobile': address.mobile}}
-        
+
     def case_open(self, cr, uid, ids, *args):
         """
             Opens Claim
         """
         res = super(crm_claim, self).case_open(cr, uid, ids, *args)
         claims = self.browse(cr, uid, ids)
-        
+
         for i in xrange(0, len(ids)):
             if not claims[i].stage_id :
                 stage_id = self._find_first_stage(cr, uid, 'claim', claims[i].section_id.id or False)
                 self.write(cr, uid, [ids[i]], {'stage_id' : stage_id})
-        
+
         return res
-    
+
     def message_new(self, cr, uid, msg, context=None):
         """
         Automatically calls when new email message arrives
@@ -219,7 +219,7 @@
         @param self: The object pointer
         @param cr: the current row, from the database cursor,
         @param uid: the current user’s ID for security checks,
-        @param ids: List of update mail’s IDs 
+        @param ids: List of update mail’s IDs
         """
         if isinstance(ids, (str, int, long)):
             ids = [ids]
@@ -267,19 +267,35 @@
 
 
 class crm_stage_claim(osv.osv):
-    
+
     def _get_type_value(self, cr, user, context):
         list = super(crm_stage_claim, self)._get_type_value(cr, user, context)
         list.append(('claim','Claim'))
         return list
-    
+
     _inherit = "crm.case.stage"
     _columns = {
             'type': fields.selection(_get_type_value, 'Type'),
     }
-   
-    
+
+
 crm_stage_claim()
 
+class crm_case_resource_type(osv.osv):
+    """ Resource Type of case """
+    _inherit = "crm.case.resource.type"
+    _description = "Campaign"
+
+    def _get_resource_type_value(self, cr, user, context=None):
+        type_list = super(crm_case_resource_type, self)._get_resource_type_value(cr, user, context)
+        type_list.append(('claim','Claim'))
+        return type_list
+
+    _columns ={
+        'type': fields.selection(_get_resource_type_value, 'Type')
+    }
+
+crm_case_resource_type()
+
 
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

=== modified file 'crm_claim/crm_claim_data.xml'
--- crm_claim/crm_claim_data.xml	2011-01-14 00:11:01 +0000
+++ crm_claim/crm_claim_data.xml	2011-04-11 14:56:38 +0000
@@ -31,11 +31,13 @@
         <record model="crm.case.resource.type" id="type_claim1">
             <field name="name">Corrective</field>
             <field name="section_id" ref="crm.section_sales_department"/>
+            <field name="type">claim</field>
         </record>
         
         <record model="crm.case.resource.type" id="type_claim2">
             <field name="name">Preventive</field>
             <field name="section_id" ref="crm.section_sales_department"/>
+            <field name="type">claim</field>
         </record>
     
         <!--

=== modified file 'crm_fundraising/crm_fundraising.py'
--- crm_fundraising/crm_fundraising.py	2011-01-14 00:11:01 +0000
+++ crm_fundraising/crm_fundraising.py	2011-04-11 14:56:38 +0000
@@ -110,3 +110,19 @@
    
     
 crm_stage_fundraising()
+
+class crm_case_resource_type(osv.osv):
+    """ Resource Type of case """
+    _inherit = "crm.case.resource.type"
+    _description = "Campaign"
+    
+    def _get_resource_type_value(self, cr, user, context=None):
+        type_list = super(crm_case_resource_type, self)._get_resource_type_value(cr, user, context)
+        type_list.append(('fundraising','Fundraising'))
+        return type_list
+    
+    _columns ={
+        'type': fields.selection(_get_resource_type_value, 'Type')
+    }
+
+crm_case_resource_type()

=== modified file 'crm_fundraising/crm_fundraising_data.xml'
--- crm_fundraising/crm_fundraising_data.xml	2011-01-14 00:11:01 +0000
+++ crm_fundraising/crm_fundraising_data.xml	2011-04-11 14:56:38 +0000
@@ -33,21 +33,25 @@
     <record model="crm.case.resource.type" id="type_fund1">
         <field name="name">Cash</field>
         <field name="section_id" ref="crm.section_sales_department"/>
+        <field name="type">fundraising</field>
     </record>
 
     <record model="crm.case.resource.type" id="type_fund2">
         <field name="name">Cheque</field>
         <field name="section_id" ref="crm.section_sales_department"/>
+        <field name="type">fundraising</field>
     </record>
 
     <record model="crm.case.resource.type" id="type_fund3">
         <field name="name">Credit Card</field>
         <field name="section_id" ref="crm.section_sales_department"/>
+        <field name="type">fundraising</field>
     </record>
 
     <record model="crm.case.resource.type" id="type_fund4">
         <field name="name">Demand Draft</field>
         <field name="section_id" ref="crm.section_sales_department"/>
+        <field name="type">fundraising</field>
     </record>
 
 </data>

=== modified file 'crm_fundraising/crm_fundraising_view.xml'
--- crm_fundraising/crm_fundraising_view.xml	2011-02-22 14:15:01 +0000
+++ crm_fundraising/crm_fundraising_view.xml	2011-04-11 14:56:38 +0000
@@ -111,7 +111,7 @@
                         <field name="user_id" string="Responsible"/>
                         <field name="date"/>
                         <field name="categ_id" select="1" widget="selection" domain="[('object_id.model', '=', 'crm.fundraising')]"/>
-                        <field name="type_id" string="Payment Mode" select="1" widget="selection"/>
+                        <field name="type_id" string="Payment Mode" select="1" widget="selection" domain="[('type','=','fundraising')]"/>
                     </group>
                     <notebook colspan="4">
                         <page string="Funds">

=== modified file 'crm_partner_assign/wizard/crm_forward_to_partner_view.xml'
--- crm_partner_assign/wizard/crm_forward_to_partner_view.xml	2011-03-08 16:40:02 +0000
+++ crm_partner_assign/wizard/crm_forward_to_partner_view.xml	2011-04-11 14:56:38 +0000
@@ -61,7 +61,6 @@
                     <field name="history" colspan="2" on_change="on_change_history(history, context)" invisible="1"/>
                     <field name="email_from"/>
                     <field name="reply_to"/>
-                    <field name="email_to" invisible="1" />
                     <field name="email_cc" invisible="1" />
                     <field name="subject"  invisible="1" />
                     <field name="html"/>


Follow ups