diff --git a/poweremail_send_wizard.py b/poweremail_send_wizard.py index ae64af6..98e126a 100644 --- a/poweremail_send_wizard.py +++ b/poweremail_send_wizard.py @@ -55,15 +55,15 @@ def _get_accounts(self, cr, uid, context=None): ) logger = netsvc.Logger() - if template.enforce_from_account: - return [(template.enforce_from_account.id, '%s (%s)' % (template.enforce_from_account.name, template.enforce_from_account.email_id))] - elif template.enforce_from_account_by_company: + if template.enforce_from_account_by_company: res = [] for account_for_company in template.enforce_from_account_by_company: res.append( (account_for_company.id, '%s (%s)' % (account_for_company.name, account_for_company.email_id)) ) return res + elif template.enforce_from_account: + return [(template.enforce_from_account.id, '%s (%s)' % (template.enforce_from_account.name, template.enforce_from_account.email_id))] elif (context.get('from', False) and isinstance(context.get('from'), int)): # If account provided from context, check availability