From 52fc96eb47fdd58072f5fc1c1edc5d61d580bfd3 Mon Sep 17 00:00:00 2001 From: Dhara Date: Wed, 16 Jun 2010 12:27:48 +0530 Subject: [PATCH] selection field in activity bzr revid: dhara@dhara-laptop-20100616065748-sytsadtsdxwrgioo --- addons/marketing_campaign/marketing_campaign.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/marketing_campaign/marketing_campaign.py b/addons/marketing_campaign/marketing_campaign.py index da3b9c41a7c..4ed49a7c954 100644 --- a/addons/marketing_campaign/marketing_campaign.py +++ b/addons/marketing_campaign/marketing_campaign.py @@ -208,10 +208,7 @@ class marketing_campaign_activity(osv.osv): 'start': fields.boolean('Start',help= "This activity is launched when the campaign starts."), 'condition': fields.char('Condition', size=256, required=True, help="Python condition to know if the activity can be launched"), - 'type': fields.selection([('email', 'E-mail'), - ('paper', 'Paper'), - ('action', 'Action'), - ('subcampaign', 'Sub-Campaign')], + 'type': fields.selection(_actions_type, 'Type', required=True, help="Describe type of action to be performed on the Activity.Eg : Send email,Send paper.."), 'email_template_id': fields.many2one('email.template','Email Template'), @@ -412,7 +409,10 @@ class marketing_campaign_workitem(osv.osv): self.write(cr, uid, wi.id, {'state': 'done'}) self.process_chain(cr, uid, wi.id, context) else: - self.write(cr, uid, wi.id, {'state': 'exception'}) + vals = {'state': 'exception'} + if type(result) == type({}) and 'error_msg' in result: + vals['error_msg'] = result['error_msg'] + self.write(cr, uid, wi.id, vals) except Exception,e: self.write(cr, uid, wi.id, {'state': 'exception', 'error_msg': str(e)}) else :