ajay javiya (OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-10click-crm-fix-aja into 
lp:~openerp-dev/openobject-addons/trunk-10click-crm.

Requested reviews:
  Jigar Amin  (OpenERP) (jam-openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-10click-crm-fix-aja/+merge/131364

Hello,
Improve code in crm.
->In crnm lead Selecting a state in the address, the onchange should apply to 
the country and ZIP fields.
->Traceback when clicking on the accept icon: KeyError: 'duration'
->On the Call button on a contact form, add the following help message.
Thank You.
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-10click-crm-fix-aja/+merge/131364
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-10click-crm.
=== modified file 'base_calendar/base_calendar.py'
--- base_calendar/base_calendar.py	2012-10-08 13:31:14 +0000
+++ base_calendar/base_calendar.py	2012-10-25 10:13:43 +0000
@@ -336,7 +336,7 @@
                     ('non-participant', 'For information Purpose')], 'Role', \
                     help='Participation role for the calendar user'),
         'state': fields.selection([('needs-action', 'Needs Action'),
-                        ('tentative', 'Tentative'),
+                        ('tentative', 'Uncertain'),
                         ('declined', 'Declined'),
                         ('accepted', 'Accepted'),
                         ('delegated', 'Delegated')], 'Status', readonly=True, \
@@ -559,7 +559,8 @@
         for vals in self.browse(cr, uid, ids, context=context):
             if vals.ref and vals.ref.user_id:
                 mod_obj = self.pool.get(vals.ref._name)
-                defaults = {'user_id': vals.user_id.id, 'organizer_id': vals.ref.user_id.id}
+                res=mod_obj.read(cr,uid,[vals.ref.id],['duration','class'],context)
+                defaults = {'user_id': vals.user_id.id, 'organizer_id': vals.ref.user_id.id,'duration':res[0]['duration'],'class':res[0]['class']}
                 mod_obj.copy(cr, uid, vals.ref.id, default=defaults, context=context)
             self.write(cr, uid, vals.id, {'state': 'accepted'}, context)
 
@@ -1012,7 +1013,7 @@
                                                 'Show Time as', states={'done': [('readonly', True)]}),
         'base_calendar_url': fields.char('Caldav URL', size=264),
         'state': fields.selection([
-            ('tentative', 'Tentative'),
+            ('tentative', 'Uncertain'),
             ('cancelled', 'Cancelled'),
             ('confirmed', 'Confirmed'),
             ], 'Status', readonly=True),

=== modified file 'base_calendar/i18n/base_calendar.pot'
--- base_calendar/i18n/base_calendar.pot	2012-08-08 14:46:13 +0000
+++ base_calendar/i18n/base_calendar.pot	2012-10-25 10:13:43 +0000
@@ -1146,7 +1146,7 @@
 #: selection:calendar.attendee,state:0
 #: selection:calendar.event,state:0
 #: selection:calendar.todo,state:0
-msgid "Tentative"
+msgid "Uncertain"
 msgstr ""
 
 #. module: base_calendar

=== modified file 'crm/crm_lead.py'
--- crm/crm_lead.py	2012-10-15 09:02:00 +0000
+++ crm/crm_lead.py	2012-10-25 10:13:43 +0000
@@ -896,6 +896,11 @@
         lead.message_post(body=message)
         return True
 
+    def onchange_state(self, cr, uid, ids, state_id, context=None):
+        if state_id:
+            state=self.pool.get('res.country.state').browse(cr, uid, state_id, context)
+            return {'value':{'state_id':state_id,'country_id':state.country_id.id,'zip':''}}
+        return {'value':{'state_id':state_id,'country_id':'','zip':''}}
 crm_lead()
 
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

=== modified file 'crm/crm_lead_view.xml'
--- crm/crm_lead_view.xml	2012-10-12 05:51:06 +0000
+++ crm/crm_lead_view.xml	2012-10-25 10:13:43 +0000
@@ -160,7 +160,7 @@
                                 <field name="street2"/>
                                 <div class="address_format">
                                     <field name="city" placeholder="City" style="width: 40%%"/>
-                                    <field name="state_id" options='{"no_open": True}' placeholder="State" style="width: 24%%"/>
+                                    <field name="state_id" on_change="onchange_state(state_id)" options='{"no_open": True}' placeholder="State" style="width: 24%%"/>
                                     <field name="zip" placeholder="ZIP" style="width: 34%%"/>
                                 </div>
                                 <field name="country_id" placeholder="Country" options='{"no_open": True}'/>

=== modified file 'crm/crm_phonecall_menu.xml'
--- crm/crm_phonecall_menu.xml	2012-10-09 05:41:05 +0000
+++ crm/crm_phonecall_menu.xml	2012-10-25 10:13:43 +0000
@@ -1,16 +1,19 @@
 <?xml version="1.0"?>
 <openerp>
 <data>
-
-    <act_window
-        id="crm_case_categ_phone_create_partner"
-        name="Schedule a Call"
-        res_model="crm.phonecall"
-        view_mode="tree,form,calendar"
-        context="{'search_default_partner_id': active_id, 'default_duration': 1.0, 'default_partner_id': active_id}"
-        groups="base.group_sale_salesman"
-        />
-
+    <record model="ir.actions.act_window" id="crm_case_categ_phone_create_partner">
+        <field name="name">Schedule a Call</field>
+        <field name="res_model">crm.phonecall</field>
+        <field name="view_mode">tree,form,calendar</field>
+        <field name="context">{'search_default_partner_id': active_id, 'default_duration': 1.0, 'default_partner_id': active_id}</field>
+        <field name="groups">base.group_sale_salesman</field>
+        <field name="help" type="html">
+            <p class="oe_view_nocontent_create">
+            No call for this contact found.
+    OpenERP allows you to easily define all the calls to be done by your sales team and follow up based on their summary.
+            </p>
+        </field>
+    </record>
     <!-- TO CONFIRM: This is fine -->
     <!-- act_window
             id="act_crm_phonecall_crm_meeting_new"

_______________________________________________
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