From 9954cd3d0866eec4ebeb74d4c48c6244a795e7bc Mon Sep 17 00:00:00 2001 From: "ajay javiya (OpenERP)" Date: Thu, 25 Oct 2012 15:12:31 +0530 Subject: [PATCH 1/5] [IMp]:Improve code in crm bzr revid: aja@tinyerp.com-20121025094231-ggp3s17n7r5ndkt5 --- addons/base_calendar/base_calendar.py | 7 ++++--- addons/base_calendar/i18n/base_calendar.pot | 2 +- addons/crm/crm_lead.py | 3 +++ addons/crm/crm_lead_view.xml | 2 +- addons/crm/crm_phonecall_menu.xml | 23 ++++++++++++--------- 5 files changed, 22 insertions(+), 15 deletions(-) diff --git a/addons/base_calendar/base_calendar.py b/addons/base_calendar/base_calendar.py index cbdc43b23af..5c20afb35a3 100644 --- a/addons/base_calendar/base_calendar.py +++ b/addons/base_calendar/base_calendar.py @@ -336,7 +336,7 @@ class calendar_attendee(osv.osv): ('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 @@ property or property parameter."), 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 @@ class calendar_event(osv.osv): '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), diff --git a/addons/base_calendar/i18n/base_calendar.pot b/addons/base_calendar/i18n/base_calendar.pot index 628f7af2baa..88ba245051f 100644 --- a/addons/base_calendar/i18n/base_calendar.pot +++ b/addons/base_calendar/i18n/base_calendar.pot @@ -1146,7 +1146,7 @@ msgstr "" #: selection:calendar.attendee,state:0 #: selection:calendar.event,state:0 #: selection:calendar.todo,state:0 -msgid "Tentative" +msgid "Uncertain" msgstr "" #. module: base_calendar diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index 9ee5aeb2301..ec615e5cee0 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -896,6 +896,9 @@ class crm_lead(base_stage, format_address, osv.osv): lead.message_post(body=message) return True + def onchange_state(self, cr, uid, ids, state_id, context=None): + state=self.pool.get('res.country.state').browse(cr, uid, state_id, context) + return {'value':{'country_id':state.country_id.id,'zip':''}} crm_lead() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml index a0dce6a7ea9..41965cd0dd2 100644 --- a/addons/crm/crm_lead_view.xml +++ b/addons/crm/crm_lead_view.xml @@ -160,7 +160,7 @@
- +
diff --git a/addons/crm/crm_phonecall_menu.xml b/addons/crm/crm_phonecall_menu.xml index 30303d4205c..7391946e37f 100644 --- a/addons/crm/crm_phonecall_menu.xml +++ b/addons/crm/crm_phonecall_menu.xml @@ -1,16 +1,19 @@ - - - + + Schedule a Call + crm.phonecall + tree,form,calendar + {'search_default_partner_id': active_id, 'default_duration': 1.0, 'default_partner_id': active_id} + base.group_sale_salesman + +

+ 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. +

+
+