From e4da848a9dc680046090a993046a6e1274c6fb29 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Fri, 16 Jul 2010 11:05:13 +0200 Subject: [PATCH 1/4] [IMP] marketing_campaign, email_template: first series of improvements during review of these modules for v6 bzr revid: odo@openerp.com-20100716090513-uvavs7wply3bpsfv --- addons/email_template/email_template.py | 10 ++- .../email_template/email_template_account.py | 20 ++--- .../email_template_account_view.xml | 2 +- .../marketing_campaign/marketing_campaign.py | 79 +++++++++++-------- .../marketing_campaign_view.xml | 15 ++-- 5 files changed, 69 insertions(+), 57 deletions(-) diff --git a/addons/email_template/email_template.py b/addons/email_template/email_template.py index 07dce405c07..5aedea7ed72 100644 --- a/addons/email_template/email_template.py +++ b/addons/email_template/email_template.py @@ -133,11 +133,13 @@ class email_template(osv.osv): string="Enforce From Account", help="Emails will be sent only from this account(which are approved)."), 'from_email' : fields.related('enforce_from_account', 'email_id', - type='char', string='From',), + type='char', string='From', + help='From Email (select mail account)', + readonly=True), 'def_to':fields.char( - 'Recepient (To)', + 'Recipient (To)', size=250, - help="The default recepient of email." + help="The default recipient of email." "Placeholders can be used here."), 'def_cc':fields.char( 'Default CC', @@ -172,7 +174,7 @@ class email_template(osv.osv): 'use_sign':fields.boolean( 'Signature', help="the signature from the User details" - "will be appened to the mail"), + " will be appended to the mail"), 'file_name':fields.char( 'File Name Pattern', size=200, diff --git a/addons/email_template/email_template_account.py b/addons/email_template/email_template_account.py index e5bbe0f5e56..8c71ce05ddf 100644 --- a/addons/email_template/email_template_account.py +++ b/addons/email_template/email_template_account.py @@ -59,21 +59,23 @@ class email_template_account(osv.osv): 'user':fields.many2one('res.users', 'Related User', required=True, readonly=True, states={'draft':[('readonly', False)]}), - 'email_id': fields.char('Email ID', + 'email_id': fields.char('From Email', size=120, required=True, readonly=True, states={'draft':[('readonly', False)]} , - help=" eg:yourname@yourdomain.com "), + help="eg: yourname@yourdomain.com "), 'smtpserver': fields.char('Server', size=120, required=True, readonly=True, states={'draft':[('readonly', False)]}, - help="Enter name of outgoing server,eg:smtp.gmail.com "), + help="Enter name of outgoing server, eg:smtp.gmail.com "), 'smtpport': fields.integer('SMTP Port ', size=64, required=True, readonly=True, states={'draft':[('readonly', False)]}, help="Enter port number,eg:SMTP-587 "), 'smtpuname': fields.char('User Name', size=120, required=False, - readonly=True, states={'draft':[('readonly', False)]}), + readonly=True, states={'draft':[('readonly', False)]}, + help="Specify the username if your SMTP server requires authentication, " + "otherwise leave it empty."), 'smtppass': fields.char('Password', size=120, invisible=True, required=False, readonly=True, @@ -91,11 +93,11 @@ class email_template_account(osv.osv): 'company':fields.selection([ ('yes', 'Yes'), ('no', 'No') - ], 'Company Mail A/c', + ], 'Corporate', readonly=True, - help="Select if this mail account does not belong" \ - "to specific user but the organisation as a whole." \ - "eg:info@somedomain.com", + help="Select if this mail account does not belong " \ + "to specific user but to the organization as a whole. " \ + "eg: info@companydomain.com", required=True, states={ 'draft':[('readonly', False)] }), @@ -316,8 +318,6 @@ class email_template_account(osv.osv): msg['To'] = u','.join(addresses_l['To']) if addresses_l['CC']: msg['CC'] = u','.join(addresses_l['CC']) -# if addresses_l['BCC']: -# msg['BCC'] = u','.join(addresses_l['BCC']) if body.get('text', False): temp_body_text = body.get('text', '') l = len(temp_body_text.replace(' ', '').replace('\r', '').replace('\n', '')) diff --git a/addons/email_template/email_template_account_view.xml b/addons/email_template/email_template_account_view.xml index 4a35134bb41..d86b4187858 100644 --- a/addons/email_template/email_template_account_view.xml +++ b/addons/email_template/email_template_account_view.xml @@ -24,7 +24,7 @@ -