From 82c632947884672beeb0c67debbffa7325d9a1dc Mon Sep 17 00:00:00 2001
From: uco <>
Date: Mon, 11 Apr 2011 17:12:30 +0200
Subject: [PATCH 01/20] [FIX] usability improvement
bzr revid: tfr@openerp.com-20110411151230-y6skgssffwqix887
---
addons/crm/crm_lead.py | 2 +-
addons/crm/crm_lead_view.xml | 2 +-
addons/crm/crm_opportunity_view.xml | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py
index fb3a8f5e223..1936466b279 100644
--- a/addons/crm/crm_lead.py
+++ b/addons/crm/crm_lead.py
@@ -143,7 +143,7 @@ class crm_lead(crm_case, osv.osv):
domain="['|',('section_id','=',section_id),('section_id','=',False), ('object_id.model', '=', 'crm.lead')]"),
'type_id': fields.many2one('crm.case.resource.type', 'Campaign', \
domain="['|',('section_id','=',section_id),('section_id','=',False)]"),
- 'channel_id': fields.many2one('res.partner.canal', 'Channel'),
+ 'channel_id': fields.many2one('res.partner.canal', 'Lead Source'),
'contact_name': fields.char('Contact Name', size=64),
'partner_name': fields.char("Customer Name", size=64,help='The name of the future partner that will be created while converting the into opportunity'),
diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml
index 55be89c2252..acfcb552791 100644
--- a/addons/crm/crm_lead_view.xml
+++ b/addons/crm/crm_lead_view.xml
@@ -335,7 +335,7 @@
domain="[('user_id','=', False)]"
help="Unassigned Leads" />
-
+
-
+
From 1766a24b0e1a48c9a1cb0d3975150359df56633a Mon Sep 17 00:00:00 2001
From: Thibault Francois
Date: Mon, 11 Apr 2011 17:38:26 +0200
Subject: [PATCH 02/20] [FIX] subject filter in extended
bzr revid: tfr@openerp.com-20110411153826-5o341bldd7cmjslv
---
addons/crm/crm_opportunity_view.xml | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/addons/crm/crm_opportunity_view.xml b/addons/crm/crm_opportunity_view.xml
index 03b2a52468d..96ee0457543 100644
--- a/addons/crm/crm_opportunity_view.xml
+++ b/addons/crm/crm_opportunity_view.xml
@@ -132,7 +132,7 @@
-
+
@@ -310,7 +310,7 @@
domain="[]"
help="Show Sales Team"/>
-
+
@@ -326,6 +326,7 @@
+
From 740012537706a67d6aba8f15a455c6b488db45a6 Mon Sep 17 00:00:00 2001
From: "Ujjvala Collins (OpenERP)"
Date: Thu, 14 Apr 2011 17:27:33 +0530
Subject: [PATCH 03/20] [IMP]: Improved phonecall views. It'll work according
to states rather than type (inbound/outbound).
bzr revid: uco@tinyerp.com-20110414115733-ushwf53kxnsl29xc
---
addons/crm/crm_phonecall.py | 11 +++--
addons/crm/crm_phonecall_demo.xml | 3 ++
addons/crm/crm_phonecall_menu.xml | 24 +++++------
addons/crm/crm_phonecall_view.xml | 70 ++-----------------------------
4 files changed, 27 insertions(+), 81 deletions(-)
diff --git a/addons/crm/crm_phonecall.py b/addons/crm/crm_phonecall.py
index 1ee36cefab2..c4e1276a4d1 100644
--- a/addons/crm/crm_phonecall.py
+++ b/addons/crm/crm_phonecall.py
@@ -53,8 +53,8 @@ class crm_phonecall(crm_case, osv.osv):
('draft', 'Draft'),
('open', 'Todo'),
('cancel', 'Cancelled'),
- ('done', 'Done'),
- ('pending', 'Pending'),
+ ('done', 'Held'),
+ ('pending', 'Not Held'),
], '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\'.\
@@ -83,10 +83,15 @@ class crm_phonecall(crm_case, osv.osv):
'message_ids': fields.one2many('mailgate.message', 'res_id', 'Messages', domain=[('model','=',_name)]),
}
+ def _get_default_state(self, cr, uid, context=None):
+ if context and context.get('default_state', False):
+ return context.get('default_state')
+ return 'open'
+
_defaults = {
'date': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'),
'priority': crm.AVAILABLE_PRIORITIES[2][0],
- 'state': 'open',
+ 'state': _get_default_state,
'user_id': lambda self,cr,uid,ctx: uid,
'active': 1,
}
diff --git a/addons/crm/crm_phonecall_demo.xml b/addons/crm/crm_phonecall_demo.xml
index 683cbd9735f..8f0661ab8be 100644
--- a/addons/crm/crm_phonecall_demo.xml
+++ b/addons/crm/crm_phonecall_demo.xml
@@ -18,6 +18,7 @@
+
@@ -33,6 +34,7 @@
+
@@ -49,6 +51,7 @@
+
diff --git a/addons/crm/crm_phonecall_menu.xml b/addons/crm/crm_phonecall_menu.xml
index 41975d9ced4..c6d06d1f49d 100644
--- a/addons/crm/crm_phonecall_menu.xml
+++ b/addons/crm/crm_phonecall_menu.xml
@@ -61,15 +61,15 @@
parent="base.menu_base_partner" sequence="4" />
- Inbound
+ Log a callcrm.phonecallformtree,calendar
-
-
-
+
+ [('state','=','done')]
+
- 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.
+ This 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.
@@ -90,24 +90,24 @@
form
-
+
-
- Outbound
+ Schedule a callcrm.phonecallformtree,calendar
-
-
+ [('state','=','open')]
+
- 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.
+ Schedule a call lists 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.
@@ -131,7 +131,7 @@
-
diff --git a/addons/crm/crm_phonecall_view.xml b/addons/crm/crm_phonecall_view.xml
index 44487e2aef5..ee88cec0129 100644
--- a/addons/crm/crm_phonecall_view.xml
+++ b/addons/crm/crm_phonecall_view.xml
@@ -43,7 +43,7 @@
name="action_make_meeting" type="object" />
-
+
@@ -61,7 +61,7 @@
-
+
@@ -111,7 +111,7 @@
-
-
-
-
- CRM - Inbound Phone Call Form
- crm.phonecall
- form
-
-
-
-
-
From ed397c9578acdb08cd5be30063f86ffdeff2667c Mon Sep 17 00:00:00 2001
From: "Ujjvala Collins (OpenERP)"
Date: Fri, 15 Apr 2011 12:28:22 +0530
Subject: [PATCH 04/20] [IMP] crm: Phonecall view changes.
bzr revid: uco@tinyerp.com-20110415065822-d5mjryxt1cdk588a
---
addons/crm/crm_phonecall_view.xml | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/addons/crm/crm_phonecall_view.xml b/addons/crm/crm_phonecall_view.xml
index ee88cec0129..958b05eb821 100644
--- a/addons/crm/crm_phonecall_view.xml
+++ b/addons/crm/crm_phonecall_view.xml
@@ -127,14 +127,14 @@
-
+
- CRM - Inbound Phone Calls Tree
+ CRM - Logged Phone Calls Treecrm.phonecalltree
-
+
From 3f45b32abe8eeec86ceb2baa9b2e9a8d4dcbce5c Mon Sep 17 00:00:00 2001
From: "Ujjvala Collins (OpenERP)"
Date: Fri, 15 Apr 2011 12:35:06 +0530
Subject: [PATCH 05/20] [REF] crm: Small refactoring in view.
bzr revid: uco@tinyerp.com-20110415070506-lw6j6zqxjf9e1swh
---
addons/crm/crm_phonecall_menu.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/addons/crm/crm_phonecall_menu.xml b/addons/crm/crm_phonecall_menu.xml
index c6d06d1f49d..c3d7e1d8df6 100644
--- a/addons/crm/crm_phonecall_menu.xml
+++ b/addons/crm/crm_phonecall_menu.xml
@@ -104,7 +104,7 @@
formtree,calendar
- [('state','=','open')]
+ [('state','!=','done')]Schedule a call lists 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.
From 13865d8ab4ad0923c0da522423f48c861780c3aa Mon Sep 17 00:00:00 2001
From: "Ujjvala Collins (OpenERP)"
Date: Tue, 19 Apr 2011 11:07:23 +0530
Subject: [PATCH 06/20] [IMP] crm: Improved Schedule/Log Call wizard on
opportunity.
bzr revid: uco@tinyerp.com-20110419053723-zagnlflbfcji4x4x
---
.../crm/wizard/crm_opportunity_to_phonecall.py | 17 +++++++++++------
.../crm_opportunity_to_phonecall_view.xml | 8 +++++---
2 files changed, 16 insertions(+), 9 deletions(-)
diff --git a/addons/crm/wizard/crm_opportunity_to_phonecall.py b/addons/crm/wizard/crm_opportunity_to_phonecall.py
index 8fc7ffb310d..7b1938deadf 100644
--- a/addons/crm/wizard/crm_opportunity_to_phonecall.py
+++ b/addons/crm/wizard/crm_opportunity_to_phonecall.py
@@ -33,9 +33,10 @@ class crm_opportunity2phonecall(osv.osv_memory):
'user_id' : fields.many2one('res.users', "Assign To"),
'date': fields.datetime('Date' , required=True),
'section_id': fields.many2one('crm.case.section', 'Sales Team'),
- 'categ_id': fields.many2one('crm.case.categ', 'Category', required=True, \
+ 'categ_id': fields.many2one('crm.case.categ', 'Category', \
domain="['|',('section_id','=',False),('section_id','=',section_id),\
- ('object_id.model', '=', 'crm.phonecall')]"),
+ ('object_id.model', '=', 'crm.phonecall')]"),
+ 'action': fields.selection([('schedule','Schedule a call'), ('log','Log a call')], 'Action', required=True),
}
def default_get(self, cr, uid, fields, context=None):
@@ -58,6 +59,7 @@ class crm_opportunity2phonecall(osv.osv_memory):
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'})
for opp in opp_obj.browse(cr, uid, record_ids, context=context):
if 'name' in fields:
res.update({'name': opp.name})
@@ -112,7 +114,7 @@ class crm_opportunity2phonecall(osv.osv_memory):
for this in self.browse(cr, uid, ids, context=context):
for opp in opp_obj.browse(cr, uid, record_ids, context=context):
- new_case = phonecall_obj.create(cr, uid, {
+ vals = {
'name' : opp.name,
'case_id' : opp.id ,
'user_id' : this.user_id and this.user_id.id or False,
@@ -126,9 +128,12 @@ class crm_opportunity2phonecall(osv.osv_memory):
'partner_mobile' : opp.partner_address_id and opp.partner_address_id.mobile or False,
'priority': opp.priority,
'opportunity_id': opp.id
- }, context=context)
-
- phonecall_obj.case_open(cr, uid, [new_case])
+ }
+ new_case = phonecall_obj.create(cr, uid, vals, context=context)
+ if this.action == 'schedule':
+ phonecall_obj.case_open(cr, uid, [new_case])
+ elif this.action == 'log':
+ phonecall_obj.case_close(cr, uid, [new_case])
value = {
'name': _('Phone Call'),
diff --git a/addons/crm/wizard/crm_opportunity_to_phonecall_view.xml b/addons/crm/wizard/crm_opportunity_to_phonecall_view.xml
index 23ddaad5bfe..0916b7c71c0 100644
--- a/addons/crm/wizard/crm_opportunity_to_phonecall_view.xml
+++ b/addons/crm/wizard/crm_opportunity_to_phonecall_view.xml
@@ -9,8 +9,10 @@
crm.opportunity2phonecallform
-
@@ -145,8 +144,7 @@
+ domain="[('object_id.model', '=', 'crm.phonecall')]"/>
From 36b300d4d12a77898df5d0e1dc2aae121c67e4e8 Mon Sep 17 00:00:00 2001
From: "Ujjvala Collins (OpenERP)"
Date: Wed, 20 Apr 2011 12:27:50 +0530
Subject: [PATCH 12/20] [REM] crm: Removed unnecessary view.
bzr revid: uco@tinyerp.com-20110420065750-teyz23h68z2mtv1e
---
addons/crm/res_partner_view.xml | 67 ---------------------------------
1 file changed, 67 deletions(-)
diff --git a/addons/crm/res_partner_view.xml b/addons/crm/res_partner_view.xml
index 18cf98e7b29..659ef075b7f 100644
--- a/addons/crm/res_partner_view.xml
+++ b/addons/crm/res_partner_view.xml
@@ -62,73 +62,6 @@
-
-
From 55977b08c87f3082e1530f85077e3ee2806350e2 Mon Sep 17 00:00:00 2001
From: "Ujjvala Collins (OpenERP)"
Date: Wed, 20 Apr 2011 14:47:39 +0530
Subject: [PATCH 13/20] [REF]: Corrections for views.
bzr revid: uco@tinyerp.com-20110420091739-iyg7ezi3gybyir51
---
addons/crm/crm_phonecall.py | 4 ++--
addons/crm/report/crm_phonecall_report.py | 2 +-
addons/crm/wizard/crm_opportunity_to_phonecall_view.xml | 8 ++++----
addons/crm/wizard/crm_phonecall_to_phonecall_view.xml | 6 +++---
4 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/addons/crm/crm_phonecall.py b/addons/crm/crm_phonecall.py
index c4e1276a4d1..fa32c1b28b1 100644
--- a/addons/crm/crm_phonecall.py
+++ b/addons/crm/crm_phonecall.py
@@ -54,7 +54,7 @@ class crm_phonecall(crm_case, osv.osv):
('open', 'Todo'),
('cancel', 'Cancelled'),
('done', 'Held'),
- ('pending', 'Not Held'),
+ ('pending', 'Pending'),
], '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\'.\
@@ -79,7 +79,7 @@ class crm_phonecall(crm_case, osv.osv):
the canall which is this opportunity source."),
'date_closed': fields.datetime('Closed', readonly=True),
'date': fields.datetime('Date'),
- 'opportunity_id': fields.many2one ('crm.lead', 'Opportunity'),
+ 'opportunity_id': fields.many2one ('crm.lead', 'Lead/Opportunity'),
'message_ids': fields.one2many('mailgate.message', 'res_id', 'Messages', domain=[('model','=',_name)]),
}
diff --git a/addons/crm/report/crm_phonecall_report.py b/addons/crm/report/crm_phonecall_report.py
index 4374bcc9d24..f68bea03880 100644
--- a/addons/crm/report/crm_phonecall_report.py
+++ b/addons/crm/report/crm_phonecall_report.py
@@ -28,7 +28,7 @@ AVAILABLE_STATES = [
('open','Todo'),
('cancel', 'Cancelled'),
('done', 'Held'),
- ('pending','Not Held')
+ ('pending','Pending')
]
diff --git a/addons/crm/wizard/crm_opportunity_to_phonecall_view.xml b/addons/crm/wizard/crm_opportunity_to_phonecall_view.xml
index 0916b7c71c0..91ca297ecc1 100644
--- a/addons/crm/wizard/crm_opportunity_to_phonecall_view.xml
+++ b/addons/crm/wizard/crm_opportunity_to_phonecall_view.xml
@@ -9,10 +9,10 @@
crm.opportunity2phonecallform
-
diff --git a/addons/crm/wizard/crm_phonecall_to_phonecall_view.xml b/addons/crm/wizard/crm_phonecall_to_phonecall_view.xml
index c4d07fccad5..ea16d27a9cc 100644
--- a/addons/crm/wizard/crm_phonecall_to_phonecall_view.xml
+++ b/addons/crm/wizard/crm_phonecall_to_phonecall_view.xml
@@ -9,8 +9,8 @@
crm.phonecall2phonecallform
-
From e0c7efa201c92a59a7cb9a7f863118894d26aaa1 Mon Sep 17 00:00:00 2001
From: "tfr@openerp.com" <>
Date: Wed, 20 Apr 2011 17:29:55 +0200
Subject: [PATCH 14/20] [MERGE] fix few crm issue
bzr revid: tfr@openerp.com-20110420152955-8pae1j13cgfqpv2h
---
addons/crm/crm.py | 4 ++--
addons/crm/wizard/crm_merge_opportunities.py | 2 ++
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/addons/crm/crm.py b/addons/crm/crm.py
index f25e4c1a0bf..d0fafbf1cf4 100644
--- a/addons/crm/crm.py
+++ b/addons/crm/crm.py
@@ -454,9 +454,9 @@ class crm_case(object):
"""
for case in self.browse(cr, uid, ids, context=context):
if not destination and not case.email_from:
- raise osv.except_osv(_('Error!'), ("Partner Email is not specified in Case"))
+ return False
if not case.user_id.user_email:
- raise osv.except_osv(_('Error!'), ("User Email is not specified in Case"))
+ return False
if destination and case.section_id.user_id:
case_email = case.section_id.user_id.user_email
diff --git a/addons/crm/wizard/crm_merge_opportunities.py b/addons/crm/wizard/crm_merge_opportunities.py
index 8cf1d14ce17..45b85227e8c 100644
--- a/addons/crm/wizard/crm_merge_opportunities.py
+++ b/addons/crm/wizard/crm_merge_opportunities.py
@@ -68,6 +68,8 @@ class crm_merge_opportunity(osv.osv_memory):
ids = list(set(ids) - set(context.get('lead_ids', False)) )
lead_obj = self.pool.get('crm.lead')
op_id = lead_obj.search(cr, uid, [('id', 'in', ids)], order='create_date' , context=context)
+ if not op_id:
+ return False
opps = lead_obj.browse(cr, uid, [op_id[0]], context=context)
return opps[0]
From 92c356a2b9395a8de10a26dfafed62d5b0bd38b4 Mon Sep 17 00:00:00 2001
From: "Ujjvala Collins (OpenERP)"
Date: Wed, 27 Apr 2011 14:52:02 +0530
Subject: [PATCH 15/20] [IMP] crm: Phone calls, usability improvements.
bzr revid: uco@tinyerp.com-20110427092202-2zhwtcyyyccbipk2
---
addons/crm/crm_phonecall_menu.xml | 10 +++++-----
addons/crm/crm_phonecall_view.xml | 2 +-
addons/crm/wizard/crm_opportunity_to_phonecall.py | 6 ++++--
.../crm/wizard/crm_opportunity_to_phonecall_view.xml | 2 +-
addons/crm/wizard/crm_phonecall_to_phonecall.py | 6 ++++--
addons/crm/wizard/crm_phonecall_to_phonecall_view.xml | 2 +-
6 files changed, 16 insertions(+), 12 deletions(-)
diff --git a/addons/crm/crm_phonecall_menu.xml b/addons/crm/crm_phonecall_menu.xml
index c3d7e1d8df6..ed818839196 100644
--- a/addons/crm/crm_phonecall_menu.xml
+++ b/addons/crm/crm_phonecall_menu.xml
@@ -4,7 +4,7 @@
- Log a call
+ Logged Callscrm.phonecallformtree,calendar
@@ -94,12 +94,12 @@
-
- Schedule a call
+ Scheduled Callscrm.phonecallformtree,calendar
@@ -131,7 +131,7 @@
-
diff --git a/addons/crm/crm_phonecall_view.xml b/addons/crm/crm_phonecall_view.xml
index 9ef661e5eb9..ee732c62f9c 100644
--- a/addons/crm/crm_phonecall_view.xml
+++ b/addons/crm/crm_phonecall_view.xml
@@ -64,7 +64,7 @@
-
+
-
+
diff --git a/addons/crm/wizard/crm_phonecall_to_phonecall.py b/addons/crm/wizard/crm_phonecall_to_phonecall.py
index b83e650d443..3064d934ff3 100644
--- a/addons/crm/wizard/crm_phonecall_to_phonecall.py
+++ b/addons/crm/wizard/crm_phonecall_to_phonecall.py
@@ -22,6 +22,8 @@
from osv import osv, fields
from tools.translate import _
+import time
+
class crm_phonecall2phonecall(osv.osv_memory):
""" Converts Phonecall to Phonecall"""
@@ -109,7 +111,7 @@ class crm_phonecall2phonecall(osv.osv_memory):
'categ_id': fields.many2one('crm.case.categ', 'Category', \
domain="['|',('section_id','=',False),('section_id','=',section_id),\
('object_id.model', '=', 'crm.phonecall')]"),
- 'date': fields.datetime('Date', required=True),
+ 'date': fields.datetime('Date'),
'section_id':fields.many2one('crm.case.section','Sales Team'),
'action': fields.selection([('schedule','Schedule a call'), ('log','Log a call')], 'Action', required=True),
}
@@ -127,7 +129,7 @@ class crm_phonecall2phonecall(osv.osv_memory):
"""
res = super(crm_phonecall2phonecall, self).default_get(cr, uid, fields, context=context)
record_id = context and context.get('active_id', False) or False
- res.update({'action': 'schedule'})
+ res.update({'action': 'schedule', 'date': time.strftime('%Y-%m-%d %H:%M:%S')})
if record_id:
phonecall = self.pool.get('crm.phonecall').browse(cr, uid, record_id, context=context)
diff --git a/addons/crm/wizard/crm_phonecall_to_phonecall_view.xml b/addons/crm/wizard/crm_phonecall_to_phonecall_view.xml
index ea16d27a9cc..feda63ee1e2 100644
--- a/addons/crm/wizard/crm_phonecall_to_phonecall_view.xml
+++ b/addons/crm/wizard/crm_phonecall_to_phonecall_view.xml
@@ -14,7 +14,7 @@
-
+
From b96c55c9cdaa9f09e32c1cb8d7ed31674c1b9ab2 Mon Sep 17 00:00:00 2001
From: "Ujjvala Collins (OpenERP)"
Date: Wed, 27 Apr 2011 14:55:44 +0530
Subject: [PATCH 16/20] [IMP] crm: Minor usability improvement.
bzr revid: uco@tinyerp.com-20110427092544-qumq22dxhpv1hcg8
---
addons/crm/crm_phonecall_menu.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/addons/crm/crm_phonecall_menu.xml b/addons/crm/crm_phonecall_menu.xml
index ed818839196..55e7657ec05 100644
--- a/addons/crm/crm_phonecall_menu.xml
+++ b/addons/crm/crm_phonecall_menu.xml
@@ -107,7 +107,7 @@
[('state','!=','done')]
- Schedule a call lists 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.
+ Scheduled 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.
From 966212d0f630cfa4452f9889ff59574c7896f837 Mon Sep 17 00:00:00 2001
From: Jigar Amin
Date: Mon, 16 May 2011 11:18:02 +0530
Subject: [PATCH 17/20] [IMP] crm : added partner field to schedule call wizard
for info
bzr revid: jam@tinyerp.com-20110516054802-isw0trjwv6n3uzmt
---
addons/crm/wizard/crm_opportunity_to_phonecall.py | 3 +++
addons/crm/wizard/crm_opportunity_to_phonecall_view.xml | 3 ++-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/addons/crm/wizard/crm_opportunity_to_phonecall.py b/addons/crm/wizard/crm_opportunity_to_phonecall.py
index b57c19eff60..af95dd5554b 100644
--- a/addons/crm/wizard/crm_opportunity_to_phonecall.py
+++ b/addons/crm/wizard/crm_opportunity_to_phonecall.py
@@ -33,6 +33,7 @@ class crm_opportunity2phonecall(osv.osv_memory):
_columns = {
'name' : fields.char('Call summary', size=64, required=True, select=1),
'user_id' : fields.many2one('res.users', "Assign To"),
+ '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', \
@@ -71,6 +72,8 @@ class crm_opportunity2phonecall(osv.osv_memory):
res.update({'section_id': opp.section_id and opp.section_id.id or False})
if 'categ_id' in fields:
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})
return res
def action_cancel(self, cr, uid, ids, context=None):
diff --git a/addons/crm/wizard/crm_opportunity_to_phonecall_view.xml b/addons/crm/wizard/crm_opportunity_to_phonecall_view.xml
index 0a0b64e43e7..d17ae1a2574 100644
--- a/addons/crm/wizard/crm_opportunity_to_phonecall_view.xml
+++ b/addons/crm/wizard/crm_opportunity_to_phonecall_view.xml
@@ -16,7 +16,8 @@
-
+
+
From 4ebbe5d4b6df02960ac7f13b27793993cf197de2 Mon Sep 17 00:00:00 2001
From: Jigar Amin
Date: Mon, 16 May 2011 11:47:45 +0530
Subject: [PATCH 18/20] [IMP] crm_phoncall : remove the visibilty of the draft
from phonecall
bzr revid: jam@tinyerp.com-20110516061745-zlhzw0gjabqn6vh1
---
addons/crm/crm.py | 9 +++++----
addons/crm/crm_phonecall.py | 7 +++----
addons/crm/crm_phonecall_view.xml | 20 ++++++++++----------
3 files changed, 18 insertions(+), 18 deletions(-)
diff --git a/addons/crm/crm.py b/addons/crm/crm.py
index d0fafbf1cf4..e0d609a43dd 100644
--- a/addons/crm/crm.py
+++ b/addons/crm/crm.py
@@ -331,8 +331,6 @@ class crm_case(object):
if not case.user_id:
data['user_id'] = uid
self.write(cr, uid, case.id, data)
-
-
self._action(cr, uid, cases, 'open')
return True
@@ -423,11 +421,14 @@ class crm_case(object):
@param ids: List of case Ids
@param *args: Tuple Value for additional Params
"""
+ state = 'draft'
+ if 'crm.phonecall' in args:
+ state = 'open'
cases = self.browse(cr, uid, ids)
cases[0].state # to fill the browse record cache
self._history(cr, uid, cases, _('Draft'))
- self.write(cr, uid, ids, {'state': 'draft', 'active': True})
- self._action(cr, uid, cases, 'draft')
+ self.write(cr, uid, ids, {'state': state, 'active': True})
+ self._action(cr, uid, cases, state)
return True
def remind_partner(self, cr, uid, ids, context=None, attach=False):
diff --git a/addons/crm/crm_phonecall.py b/addons/crm/crm_phonecall.py
index fa32c1b28b1..d6f64572696 100644
--- a/addons/crm/crm_phonecall.py
+++ b/addons/crm/crm_phonecall.py
@@ -50,13 +50,12 @@ class crm_phonecall(crm_case, osv.osv):
'company_id': fields.many2one('res.company', 'Company'),
'description': fields.text('Description'),
'state': fields.selection([
- ('draft', 'Draft'),
('open', 'Todo'),
('cancel', 'Cancelled'),
('done', 'Held'),
('pending', 'Pending'),
], 'State', size=16, readonly=True,
- help='The state is set to \'Draft\', when a case is created.\
+ help='The state is set to \'Todo\', 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\'.'),
@@ -126,14 +125,14 @@ class crm_phonecall(crm_case, osv.osv):
return res
def case_reset(self, cr, uid, ids, *args):
- """Resets case as draft
+ """Resets case as Todo
@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
"""
- res = super(crm_phonecall, self).case_reset(cr, uid, ids, args)
+ res = super(crm_phonecall, self).case_reset(cr, uid, ids, args, 'crm.phonecall')
self.write(cr, uid, ids, {'duration': 0.0})
return res
diff --git a/addons/crm/crm_phonecall_view.xml b/addons/crm/crm_phonecall_view.xml
index ee732c62f9c..f0e5565f1c8 100644
--- a/addons/crm/crm_phonecall_view.xml
+++ b/addons/crm/crm_phonecall_view.xml
@@ -35,16 +35,16 @@
-
-
-
+
+
+
@@ -108,17 +108,17 @@
-
@@ -183,7 +183,7 @@
+ domain="[('state','in', ('open','pending'))]"/>
Date: Mon, 16 May 2011 18:15:56 +0530
Subject: [PATCH 19/20] [IMP] crm_phonecall : convert to opportunity possible
in all state
bzr revid: jam@tinyerp.com-20110516124556-lnfnc3gmxhgxcr1j
---
addons/crm/crm_phonecall_view.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/addons/crm/crm_phonecall_view.xml b/addons/crm/crm_phonecall_view.xml
index f0e5565f1c8..86061c6e5ce 100644
--- a/addons/crm/crm_phonecall_view.xml
+++ b/addons/crm/crm_phonecall_view.xml
@@ -70,7 +70,7 @@
+ attrs="{'invisible':[('opportunity_id','!=',False)]}" />
Date: Mon, 16 May 2011 18:18:54 +0530
Subject: [PATCH 20/20] [IMP] crm_phonecall : reorder convert to opportunity at
the bottom (of the three button)
bzr revid: jam@tinyerp.com-20110516124854-o0bny0pam6bu5csd
---
addons/crm/crm_phonecall_view.xml | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/addons/crm/crm_phonecall_view.xml b/addons/crm/crm_phonecall_view.xml
index 86061c6e5ce..2490526bb0e 100644
--- a/addons/crm/crm_phonecall_view.xml
+++ b/addons/crm/crm_phonecall_view.xml
@@ -67,15 +67,15 @@
-
-
+
+