From 966212d0f630cfa4452f9889ff59574c7896f837 Mon Sep 17 00:00:00 2001 From: Jigar Amin Date: Mon, 16 May 2011 11:18:02 +0530 Subject: [PATCH 1/4] [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 2/4] [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 @@