Hardik Ansodariya (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-usability2-lead_opportunity-han into 
lp:~openerp-dev/openobject-addons/trunk-usability2.

Requested reviews:
  Amit (Open ERP) (apa-tiny)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-usability2-lead_opportunity-han/+merge/79237
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-usability2-lead_opportunity-han/+merge/79237
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-usability2.
=== modified file 'crm/crm_lead_demo.xml'
--- crm/crm_lead_demo.xml	2011-09-20 12:36:35 +0000
+++ crm/crm_lead_demo.xml	2011-10-13 09:40:32 +0000
@@ -270,6 +270,8 @@
             <field name="categ_id" ref="crm.categ_oppor3"/>
             <field name="stage_id" ref="crm.stage_lead2"/>
             <field eval="'Pricing Information of Onsite Intervention'" name="name"/>
+            <field eval="time.strftime('%Y') +'/'+ str(int(time.strftime('%m')) + 1) +'/'+ time.strftime('%d')" name="date_action"/>
+            <field eval="time.strftime('%Y') +'/'+ str(int(time.strftime('%m')) + 2) +'/'+ time.strftime('%d')" name="date_deadline"/>
 	    <field eval="'Send price list regarding our interventions'" name="title_action"/>
             <field name="partner_name">BalmerInc S.A.</field>
             <field name="street">Rue des Palais 51, bte 33</field>
@@ -291,6 +293,8 @@
             <field name="categ_id" ref="crm.categ_oppor3"/>
             <field name="stage_id" ref="crm.stage_lead2"/>
             <field eval="'Interest in your Kitchen Design Project'" name="name"/>
+            <field eval="time.strftime('%Y') +'/'+ str(int(time.strftime('%m')) + 1) +'/'+ time.strftime('%d')" name="date_action"/>
+            <field eval="time.strftime('%Y') +'/'+ str(int(time.strftime('%m')) + 2) +'/'+ time.strftime('%d')" name="date_deadline"/>
 	    <field eval="'Send Catalogue by E-Mail'" name="title_action"/>
             <field name="partner_name">Lucie Vonck</field>
             <field name="street">Chaussée de Namur</field>
@@ -313,6 +317,8 @@
             <field name="categ_id" ref="crm.categ_oppor6"/>
             <field name="stage_id" ref="crm.stage_lead2"/>
             <field eval="'Plan train our students on your product'" name="name"/>
+            <field eval="time.strftime('%Y') +'/'+ str(int(time.strftime('%m')) + 1) +'/'+ time.strftime('%d')" name="date_action"/>
+            <field eval="time.strftime('%Y') +'/'+ str(int(time.strftime('%m')) + 2) +'/'+ time.strftime('%d')" name="date_deadline"/>
 	    <field eval="'Call to define real needs about training'" name="title_action"/>
             <field eval="4000" name="zip"/>
             <field name="partner_name">Université de Liège</field>
@@ -336,6 +342,8 @@
             <field name="categ_id" ref="crm.categ_oppor2"/>
             <field name="stage_id" ref="crm.stage_lead2"/>
             <field eval="'Plan to buy 66 keyboards and 66 mouses'" name="name"/>
+            <field eval="time.strftime('%Y') +'/'+ str(int(time.strftime('%m')) + 1) +'/'+ time.strftime('%d')" name="date_action"/>
+            <field eval="time.strftime('%Y') +'/'+ str(int(time.strftime('%m')) + 2) +'/'+ time.strftime('%d')" name="date_deadline"/>
 	    <field eval="'Propose the kit keyboard+mouse'" name="title_action"/>
             <field name="partner_name">Bank Wealthy and sons</field>
             <field name="street">1 rue Rockfeller</field>
@@ -359,6 +367,7 @@
             <field name="categ_id" ref="crm.categ_oppor7"/>
             <field name="stage_id" ref="crm.stage_lead5"/>
             <field eval="'Need 20 Days of Consultancy'" name="name"/>
+            <field eval="time.strftime('%Y-%m-%d')" name="date_deadline"/>
             <field eval="'[email protected]'" name="email_from"/>
         </record>
         <record id="crm_case_abcfuelcounits0" model="crm.lead">
@@ -376,6 +385,8 @@
             <field name="categ_id" ref="crm.categ_oppor5"/>
             <field name="stage_id" ref="crm.stage_lead4"/>
             <field eval="'Need new design for my website'" name="name"/>
+            <field eval="time.strftime('%Y') +'/'+ time.strftime('%m') +'/'+ str(int(time.strftime('%d')) + 15)" name="date_action"/>
+            <field eval="time.strftime('%Y') +'/'+ time.strftime('%m') +'/'+ str(int(time.strftime('%d')) + 15)" name="date_deadline"/>
             <field eval="'[email protected]'" name="email_from"/>
 	    <field eval="'Convert to quote'" name="title_action"/>
             <field name="partner_name">Dubois sprl</field>
@@ -428,6 +439,8 @@
             <field name="categ_id" ref="crm.categ_oppor2"/>
             <field name="stage_id" ref="crm.stage_lead2"/>
             <field eval="'Plan to attend a training'" name="name"/>
+            <field eval="time.strftime('%Y') +'/'+ str(int(time.strftime('%m')) + 1) +'/'+ time.strftime('%d')" name="date_action"/>
+            <field eval="time.strftime('%Y') +'/'+ str(int(time.strftime('%m')) + 2) +'/'+ time.strftime('%d')" name="date_deadline"/>
 	    <field eval="'Call to give info about next training session'" name="title_action"/>
             <field name="partner_name">Axelor</field>
             <field name="street">12 rue Albert Einstein</field>
@@ -450,6 +463,8 @@
             <field name="categ_id" ref="crm.categ_oppor1"/>
             <field name="stage_id" ref="crm.stage_lead3"/>
             <field eval="'Need customize the solution'" name="name"/>
+            <field eval="time.strftime('%Y') +'/'+ time.strftime('%m') +'/'+ str(int(time.strftime('%d')) + 15)" name="date_action"/>
+            <field eval="time.strftime('%Y') +'/'+ str(int(time.strftime('%m')) + 1) +'/'+ time.strftime('%d')" name="date_deadline"/>
             <field eval="'Conf call with technical service'" name="title_action"/>
             <field name="partner_name">Thymbra</field>
             <field name="street">Palermo, Capital Federal</field>
@@ -473,6 +488,8 @@
             <field name="categ_id" ref="crm.categ_oppor1"/>
             <field name="stage_id" ref="crm.stage_lead3"/>
             <field eval="'Interest in your customizable PC'" name="name"/>
+            <field eval="time.strftime('%Y') +'/'+ time.strftime('%m') +'/'+ str(int(time.strftime('%d')) + 15)" name="date_action"/>
+            <field eval="time.strftime('%Y') +'/'+ str(int(time.strftime('%m')) + 1) +'/'+ time.strftime('%d')" name="date_deadline"/>
             <field eval="'Ask for the good receprion of the proposition'" name="title_action"/>
             <field name="partner_name">Eric Dubois</field>
             <field name="street">Chaussée de Binche, 27</field>

=== modified file 'crm/crm_lead_view.xml'
--- crm/crm_lead_view.xml	2011-10-02 17:31:16 +0000
+++ crm/crm_lead_view.xml	2011-10-13 09:40:32 +0000
@@ -462,7 +462,7 @@
                     <field name="user_id"/>
 
                     <button string="Schedule/Log Call"
-                    name="%(opportunity2phonecall_act)d" icon="terp-call-start" type="action" groups="base.group_extended"/>
+                    name="%(opportunity2phonecall_act)d" icon="terp-call-start" type="action"/>
 
                     <field name="planned_revenue"/>
                     <field name="probability"/>

=== modified file 'crm/report/crm_lead_report_view.xml'
--- crm/report/crm_lead_report_view.xml	2011-10-02 17:31:16 +0000
+++ crm/report/crm_lead_report_view.xml	2011-10-13 09:40:32 +0000
@@ -261,7 +261,6 @@
             parent="base.next_id_64" action="action_report_crm_lead" sequence="3"/>
 
        <menuitem name="Opportunities Analysis" id="menu_report_crm_opportunities_tree"
-            groups="base.group_extended"
             parent="base.next_id_64" action="action_report_crm_opportunity" sequence="4"/>
 
     </data>

=== modified file 'crm/wizard/crm_lead_to_partner.py'
--- crm/wizard/crm_lead_to_partner.py	2011-10-02 17:31:16 +0000
+++ crm/wizard/crm_lead_to_partner.py	2011-10-13 09:40:32 +0000
@@ -86,8 +86,20 @@
                     partner_ids = partner_obj.search(cr, uid, [('address', 'in', address_ids)], context=context)
                     
             # Find partner name that matches the name of the lead
-            if not partner_ids and lead.partner_name:
-                partner_ids = partner_obj.search(cr, uid, [('name', '=', lead.partner_name)], context=context)
+            if type(lead.partner_name).__name__ == 'unicode':
+                partner_name = str(lead.partner_name)
+            partner_name = partner_name.capitalize()
+            partner = ''
+            upper = False
+            for name in partner_name:
+	            if upper:
+		            partner+=name.upper()
+	            else:
+		            partner+=name
+	            upper = name.isspace()
+	        
+            if not partner_ids and partner:
+                partner_ids = partner_obj.search(cr, uid, [('name', '=', partner)], context=context)
                 
             partner_id = partner_ids and partner_ids[0] or False
             

=== modified file 'crm/wizard/crm_opportunity_to_phonecall.py'
--- crm/wizard/crm_opportunity_to_phonecall.py	2011-06-29 11:05:31 +0000
+++ crm/wizard/crm_opportunity_to_phonecall.py	2011-10-13 09:40:32 +0000
@@ -35,13 +35,16 @@
     _columns = {
         'name' : fields.char('Call summary', size=64, required=True, select=1),
         'user_id' : fields.many2one('res.users', "Assign To"),
+        'contact_name':fields.char('Contact', size=64),
+        'phone':fields.char('Phone', size=64),
         'partner_id' : fields.many2one('res.partner', "Partner"),
         'date': fields.datetime('Date'),
         'section_id': fields.many2one('crm.case.section', 'Sales Team'),
         'categ_id': fields.many2one('crm.case.categ', 'Category',  \
                         domain="['|',('section_id','=',False),('section_id','=',section_id),\
                         ('object_id.model', '=', 'crm.phonecall')]"),
-        'action': fields.selection([('schedule','Schedule a call'), ('log','Log a call')], 'Action', required=True), 
+        'action': fields.selection([('schedule','Schedule a call'), ('log','Log a call')], 'Action', required=True),
+        'note':fields.text('Note'), 
     }
 
     def default_get(self, cr, uid, fields, context=None):
@@ -64,7 +67,7 @@
 
         record_ids = context and context.get('active_ids', []) or []
         res = super(crm_opportunity2phonecall, self).default_get(cr, uid, fields, context=context)
-        res.update({'action': 'schedule', 'date': time.strftime('%Y-%m-%d %H:%M:%S')})
+        res.update({'action': 'log', 'date': time.strftime('%Y-%m-%d %H:%M:%S')})
         for opp in opp_obj.browse(cr, uid, record_ids, context=context):
             if 'name' in fields:
                 res.update({'name': opp.name})
@@ -76,6 +79,12 @@
                 res.update({'categ_id': categ_id})
             if 'partner_id' in fields:
                 res.update({'partner_id': opp.partner_id and opp.partner_id.id or False})
+            if 'note' in fields:
+                res.update({'note': opp.description})
+            if 'contact_name' in fields:
+                res.update({'contact_name': opp.partner_address_id and opp.partner_address_id.name or False})
+            if 'phone' in fields:
+                res.update({'phone': opp.phone or (opp.partner_address_id and opp.partner_address_id.phone or False)})
         return res
 
     def action_cancel(self, cr, uid, ids, context=None):
@@ -142,6 +151,7 @@
                
                 if this.action == 'log':
                     phonecall_obj.case_close(cr, uid, [new_case])
+                    return {'type': 'ir.actions.act_window_close'}
 
             value = {
                 'name': _('Phone Call'),

=== modified file 'crm/wizard/crm_opportunity_to_phonecall_view.xml'
--- crm/wizard/crm_opportunity_to_phonecall_view.xml	2011-06-16 15:32:44 +0000
+++ crm/wizard/crm_opportunity_to_phonecall_view.xml	2011-10-13 09:40:32 +0000
@@ -16,10 +16,19 @@
                     <field name="name"/>
                     <field name="date" string="Planned Date" attrs="{'invisible': [('action','=','log')]}"/>
                     <newline/>
-                    <field name="partner_id" readonly="True"/>
-                    <field name="user_id" />                    
-                    <field name="section_id" widget="selection" />
-                    <field name="categ_id" string="Type" widget="selection" domain="[('object_id.model', '=', 'crm.phonecall')]"/>
+                    <group colspan="4">
+                        <field name="partner_id" readonly="True"/>
+                        <field name="categ_id" string="Type" widget="selection" domain="[('object_id.model', '=', 'crm.phonecall')]"/>
+                        <field name="contact_name"/>
+                        <field name="phone"/>
+                    </group>
+                    <group colspan="4">
+                        <field name="user_id" attrs="{'invisible': [('action','=','log')]}"/>                    
+                        <field name="section_id" widget="selection" attrs="{'invisible': [('action','=','log')]}"/>
+                    </group>
+                    <group colspan="4">
+                        <field name="note"/>
+                    </group>
                     <separator string="" colspan="4"/>
                     <group colspan="4" col="3">
                         <button name="action_cancel" string="_Cancel" icon="gtk-cancel" special="cancel" />

_______________________________________________
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