diff --git a/addons/account/edi/invoice_action_data.xml b/addons/account/edi/invoice_action_data.xml
index ce837c6662b..0eec6d27785 100644
--- a/addons/account/edi/invoice_action_data.xml
+++ b/addons/account/edi/invoice_action_data.xml
@@ -38,7 +38,7 @@
% endif
- Your contact: ${object.user_id.name}
+ Your contact: ${object.user_id.name}
@@ -133,7 +133,7 @@ A new invoice is available for ${object.partner_id.name}:
% if object.origin:
| Order reference: ${object.origin}
% endif
- | Your contact: ${object.user_id.name} ${object.user_id.user_email and '<%s>'%(object.user_id.user_email) or ''}
+ | Your contact: ${object.user_id.name} ${object.user_id.email and '<%s>'%(object.user_id.email) or ''}
You can view the invoice document, download it and pay online using the following link:
${ctx.get('edi_web_url_view') or 'n/a'}
@@ -160,7 +160,7 @@ Thank you for choosing ${object.company_id.name}!
--
-${object.user_id.name} ${object.user_id.user_email and '<%s>'%(object.user_id.user_email) or ''}
+${object.user_id.name} ${object.user_id.email and '<%s>'%(object.user_id.email) or ''}
${object.company_id.name}
% if object.company_id.street:
${object.company_id.street or ''}
diff --git a/addons/account_analytic_analysis/cron_account_analytic_account.py b/addons/account_analytic_analysis/cron_account_analytic_account.py
index caa9067b227..065fdc5b907 100644
--- a/addons/account_analytic_analysis/cron_account_analytic_account.py
+++ b/addons/account_analytic_analysis/cron_account_analytic_account.py
@@ -53,7 +53,7 @@ class analytic_account(osv.osv):
('name', 'not ilike', 'maintenance'),
('partner_id', '!=', False),
('user_id', '!=', False),
- ('user_id.user_email', '!=', False),
+ ('user_id.email', '!=', False),
('state', 'in', ('draft', 'open')),
'|', ('date', '<', time.strftime('%Y-%m-%d')), ('date', '=', False),
]
@@ -70,7 +70,7 @@ class analytic_account(osv.osv):
for user, data in users.iteritems():
subject = '[OPENERP] Reporting: Analytic Accounts'
body = Template(MAKO_TEMPLATE).render_unicode(user=user, partners=data)
- tools.email_send('noreply@openerp.com', [user.user_email, ], subject, body)
+ tools.email_send('noreply@openerp.com', [user.email, ], subject, body)
return True
diff --git a/addons/auth_signup/auth_signup.py b/addons/auth_signup/auth_signup.py
index ebc72b3aeac..fedce607206 100644
--- a/addons/auth_signup/auth_signup.py
+++ b/addons/auth_signup/auth_signup.py
@@ -4,7 +4,7 @@ class res_users(osv.Model):
_inherit = 'res.users'
_sql_constraints = [
- ('email_uniq', 'UNIQUE (user_email)', 'You can not have two users with the same email!')
+ ('email_uniq', 'UNIQUE (email)', 'You can not have two users with the same email!')
]
class signup_signup(osv.TransientModel):
@@ -24,7 +24,7 @@ class signup_signup(osv.TransientModel):
new_user = {
'name': values['name'],
'login': values['email'],
- 'user_email': values['email'],
+ 'email': values['email'],
'password': values['password'],
'active': True,
}
diff --git a/addons/base_action_rule/base_action_rule.py b/addons/base_action_rule/base_action_rule.py
index 7699256985c..b6eacda63c0 100644
--- a/addons/base_action_rule/base_action_rule.py
+++ b/addons/base_action_rule/base_action_rule.py
@@ -292,7 +292,7 @@ the rule to mark CC(mail to any other person defined in actions)."),
'object_description': hasattr(obj, 'description') and obj.description or False,
'object_user': hasattr(obj, 'user_id') and (obj.user_id and obj.user_id.name) or '/',
'object_user_email': hasattr(obj, 'user_id') and (obj.user_id and \
- obj.user_id.user_email) or '/',
+ obj.user_id.email) or '/',
'object_user_phone': hasattr(obj, 'partner_address_id') and (obj.partner_address_id and \
obj.partner_address_id.phone) or '/',
'partner': hasattr(obj, 'partner_id') and (obj.partner_id and obj.partner_id.name) or '/',
@@ -319,8 +319,8 @@ the rule to mark CC(mail to any other person defined in actions)."),
mail_message = self.pool.get('mail.message')
body = self.format_mail(obj, body)
if not emailfrom:
- if hasattr(obj, 'user_id') and obj.user_id and obj.user_id.user_email:
- emailfrom = obj.user_id.user_email
+ if hasattr(obj, 'user_id') and obj.user_id and obj.user_id.email:
+ emailfrom = obj.user_id.email
name = '[%d] %s' % (obj.id, tools.ustr(obj.name))
emailfrom = tools.ustr(emailfrom)
@@ -419,7 +419,7 @@ the rule to mark CC(mail to any other person defined in actions)."),
emails = []
if hasattr(obj, 'user_id') and action.act_mail_to_user:
if obj.user_id:
- emails.append(obj.user_id.user_email)
+ emails.append(obj.user_id.email)
if action.act_mail_to_watchers:
emails += (action.act_email_cc or '').split(',')
diff --git a/addons/base_status/base_stage.py b/addons/base_status/base_stage.py
index 44e9de89162..775de51394c 100644
--- a/addons/base_status/base_stage.py
+++ b/addons/base_status/base_stage.py
@@ -57,7 +57,7 @@ class base_stage(object):
if not context or not context.get('portal'):
return False
user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
- return user.user_email
+ return user.email
def _get_default_user(self, cr, uid, context=None):
""" Gives current user id
@@ -301,15 +301,15 @@ class base_stage(object):
for case in self.browse(cr, uid, ids, context=context):
if not destination and not case.email_from:
return False
- if not case.user_id.user_email:
+ if not case.user_id.email:
return False
if destination and case.section_id.user_id:
- case_email = case.section_id.user_id.user_email
+ case_email = case.section_id.user_id.email
else:
- case_email = case.user_id.user_email
+ case_email = case.user_id.email
src = case_email
- dest = case.user_id.user_email or ""
+ dest = case.user_id.email or ""
body = case.description or ""
for message in case.message_ids:
if message.email_from and message.body_text:
@@ -366,8 +366,8 @@ class base_stage(object):
l=[]
if case.email_cc:
l.append(case.email_cc)
- if case.user_id and case.user_id.user_email:
- l.append(case.user_id.user_email)
+ if case.user_id and case.user_id.email:
+ l.append(case.user_id.email)
res[case.id] = l
return res
diff --git a/addons/base_status/base_state.py b/addons/base_status/base_state.py
index 4247e67f435..8fa2f92e22a 100644
--- a/addons/base_status/base_state.py
+++ b/addons/base_status/base_state.py
@@ -55,7 +55,7 @@ class base_state(object):
if not context or not context.get('portal'):
return False
user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
- return user.user_email
+ return user.email
def _get_default_user(self, cr, uid, context=None):
""" Gives current user id
diff --git a/addons/crm/crm_action_rule.py b/addons/crm/crm_action_rule.py
index 96d182113c8..3e3bdc90d08 100644
--- a/addons/crm/crm_action_rule.py
+++ b/addons/crm/crm_action_rule.py
@@ -49,8 +49,8 @@ class base_action_rule(osv.osv):
mail_message = self.pool.get('mail.message')
body = self.format_mail(obj, body)
if not emailfrom:
- if hasattr(obj, 'user_id') and obj.user_id and obj.user_id.user_email:
- emailfrom = obj.user_id.user_email
+ if hasattr(obj, 'user_id') and obj.user_id and obj.user_id.email:
+ emailfrom = obj.user_id.email
name = '[%d] %s' % (obj.id, tools.ustr(obj.name))
emailfrom = tools.ustr(emailfrom)
diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py
index 29d3eefec70..451dd795a94 100644
--- a/addons/crm/crm_lead.py
+++ b/addons/crm/crm_lead.py
@@ -243,7 +243,7 @@ class crm_lead(base_stage, osv.osv):
'partner_address_name': fields.related('partner_id', 'name', type='char', string='Partner Contact Name', readonly=True),
'partner_address_email': fields.related('partner_id', 'email', type='char', string='Partner Contact Email', readonly=True),
'company_currency': fields.related('company_id', 'currency_id', 'symbol', type='char', string='Company Currency', readonly=True),
- 'user_email': fields.related('user_id', 'user_email', type='char', string='User Email', readonly=True),
+ 'user_email': fields.related('user_id', 'email', type='char', string='User Email', readonly=True),
'user_login': fields.related('user_id', 'login', type='char', string='User Login', readonly=True),
# Fields for address, due to separation from crm and res.partner
@@ -692,11 +692,11 @@ class crm_lead(base_stage, osv.osv):
"""
#TOFIX: mail template should be used here instead of fix subject, body text.
message = self.pool.get('mail.message')
- email_to = lead.user_id and lead.user_id.user_email
+ email_to = lead.user_id and lead.user_id.email
if not email_to:
return False
- email_from = lead.section_id and lead.section_id.user_id and lead.section_id.user_id.user_email or email_to
+ email_from = lead.section_id and lead.section_id.user_id and lead.section_id.user_id.email or email_to
partner = lead.partner_id and lead.partner_id.name or lead.partner_name
subject = "lead %s converted into opportunity" % lead.name
body = "Info \n Id : %s \n Subject: %s \n Partner: %s \n Description : %s " % (lead.id, lead.name, lead.partner_id.name, lead.description)
diff --git a/addons/crm_partner_assign/wizard/crm_forward_to_partner.py b/addons/crm_partner_assign/wizard/crm_forward_to_partner.py
index 2bc2d67d00a..d479f8b1bd5 100644
--- a/addons/crm_partner_assign/wizard/crm_forward_to_partner.py
+++ b/addons/crm_partner_assign/wizard/crm_forward_to_partner.py
@@ -43,16 +43,13 @@ class crm_lead_forward_to_partner(osv.osv_memory):
_defaults = {
'send_to' : 'email',
'history': 'latest',
- 'email_from': lambda self, cr, uid, *a: self.pool.get('res.users')._get_email_from(cr, uid, uid)[uid],
+ 'email_from': lambda s, cr, uid, c: s.pool.get('res.users').browse(cr, uid, uid, c).email,
}
-
-
- def on_change_email(self, cr, uid, ids, user):
+ def on_change_email(self, cr, uid, ids, user, context=None):
if not user:
return {'value': {'email_to': False}}
- email = self.pool.get('res.users')._get_email_from(cr, uid, [user])[user]
- return {'value': {'email_to': email}}
+ return {'value': {'email_to': self.pool.get('res.users').browse(cr, uid, uid, context=context).email}}
def on_change_history(self, cr, uid, ids, history_type, context=None):
"""Gives message body according to type of history selected
@@ -80,7 +77,7 @@ class crm_lead_forward_to_partner(osv.osv_memory):
partner = partner_obj.browse(cr, uid, [partner_id])
user_id = partner and partner[0].user_id or False
data.update({'email_from': partner and partner[0].email or "",
- 'email_cc' : user_id and user_id.user_email or '',
+ 'email_cc' : user_id and user_id.user or '',
'user_id': user_id and user_id.id or False})
return {'value' : data}
@@ -185,7 +182,7 @@ class crm_lead_forward_to_partner(osv.osv_memory):
if partner_assigned_id:
assigned_partner = partner.browse(cr, uid, partner_assigned_id, context=context)
user_id = assigned_partner.user_id and assigned_partner.user_id.id or False
- email_cc = assigned_partner.user_id and assigned_partner.user_id.user_email or ''
+ email_cc = assigned_partner.user_id and assigned_partner.user_id.email or ''
email = assigned_partner.email
res.update({
diff --git a/addons/event/email_template.xml b/addons/event/email_template.xml
index 4485dfc785a..2666ece9921 100644
--- a/addons/event/email_template.xml
+++ b/addons/event/email_template.xml
@@ -4,7 +4,7 @@
diff --git a/addons/mail/data/mail_group_data.xml b/addons/mail/data/mail_group_data.xml
index 09a6ca29a2d..49c6fbdc1b6 100644
--- a/addons/mail/data/mail_group_data.xml
+++ b/addons/mail/data/mail_group_data.xml
@@ -21,7 +21,7 @@
% endif
- Your contact: ${object.validator.name}
+ Your contact: ${object.validator.name}
@@ -121,7 +121,7 @@ Here is a ${object.state in ('draft', 'sent') and 'request for quotation' or 'pu
% if object.partner_ref:
| Your reference: ${object.partner_ref}
% endif
- | Your contact: ${object.validator.name} ${object.validator.user_email and '<%s>'%(object.validator.user_email) or ''}
+ | Your contact: ${object.validator.name} ${object.validator.email and '<%s>'%(object.validator.email) or ''}
You can view the ${object.state in ('draft', 'sent') and 'request for quotation' or 'order confirmation'} and download it using the following link:
${ctx.get('edi_web_url_view') or 'n/a'}
@@ -132,7 +132,7 @@ Thank you!
--
-${object.validator.name} ${object.validator.user_email and '<%s>'%(object.validator.user_email) or ''}
+${object.validator.name} ${object.validator.email and '<%s>'%(object.validator.email) or ''}
${object.company_id.name}
% if object.company_id.street:
${object.company_id.street or ''}
diff --git a/addons/sale/edi/sale_order_action_data.xml b/addons/sale/edi/sale_order_action_data.xml
index 2fe0a8cbfd3..181bd8183d7 100644
--- a/addons/sale/edi/sale_order_action_data.xml
+++ b/addons/sale/edi/sale_order_action_data.xml
@@ -37,7 +37,7 @@
% endif
- Your contact: ${object.user_id.name}
+ Your contact: ${object.user_id.name}
@@ -139,7 +139,7 @@ Here is your ${object.state in ('draft', 'sent') and 'quotation' or 'order confi
% if object.client_order_ref:
| Your reference: ${object.client_order_ref}
% endif
- | Your contact: ${object.user_id.name} ${object.user_id.user_email and '<%s>'%(object.user_id.user_email) or ''}
+ | Your contact: ${object.user_id.name} ${object.user_id.email and '<%s>'%(object.user_id.email) or ''}
You can view the ${object.state in ('draft', 'sent') and 'quotation' or 'order confirmation'}, download it and even pay online using the following link:
${ctx.get('edi_web_url_view') or 'n/a'}
@@ -166,7 +166,7 @@ Thank you for choosing ${object.company_id.name}!
--
-${object.user_id.name} ${object.user_id.user_email and '<%s>'%(object.user_id.user_email) or ''}
+${object.user_id.name} ${object.user_id.email and '<%s>'%(object.user_id.email) or ''}
${object.company_id.name}
% if object.company_id.street:
${object.company_id.street or ''}
diff --git a/addons/share/wizard/share_wizard.py b/addons/share/wizard/share_wizard.py
index b14da39633e..598bb085967 100644
--- a/addons/share/wizard/share_wizard.py
+++ b/addons/share/wizard/share_wizard.py
@@ -196,7 +196,7 @@ class share_wizard(osv.TransientModel):
}
def has_email(self, cr, uid, context=None):
- return bool(self.pool.get('res.users').browse(cr, uid, uid, context=context).user_email)
+ return bool(self.pool.get('res.users').browse(cr, uid, uid, context=context).email)
def go_step_1(self, cr, uid, ids, context=None):
wizard_data = self.browse(cr,uid,ids,context)[0]
@@ -241,7 +241,7 @@ class share_wizard(osv.TransientModel):
if not wizard_data.invite:
existing = user_obj.search(cr, UID_ROOT, [('login', '=', new_user)])
else:
- existing = user_obj.search(cr, UID_ROOT, [('user_email', '=', new_user)])
+ existing = user_obj.search(cr, UID_ROOT, [('email', '=', new_user)])
existing_ids.extend(existing)
if existing:
new_line = { 'user_id': existing[0],
@@ -253,7 +253,7 @@ class share_wizard(osv.TransientModel):
'login': new_user,
'password': new_pass,
'name': new_user,
- 'user_email': new_user,
+ 'email': new_user,
'groups_id': [(6,0,[group_id])],
'share': True,
'message_email_pref': 'all',
@@ -825,12 +825,12 @@ class share_wizard(osv.TransientModel):
message_obj = self.pool.get('mail.message')
notification_obj = self.pool.get('mail.notification')
user = self.pool.get('res.users').browse(cr, UID_ROOT, uid)
- if not user.user_email:
+ if not user.email:
raise osv.except_osv(_('Email required'), _('The current user must have an email address configured in User Preferences to be able to send outgoing emails.'))
# TODO: also send an HTML version of this mail
for result_line in wizard_data.result_line_ids:
- email_to = result_line.user_id.user_email
+ email_to = result_line.user_id.email
if not email_to:
continue
subject = _('Invitation to collaborate about %s') % (wizard_data.record_name)
@@ -849,20 +849,20 @@ class share_wizard(osv.TransientModel):
body += "--\n"
body += _("OpenERP is a powerful and user-friendly suite of Business Applications (CRM, Sales, HR, etc.)\n"
"It is open source and can be found on http://www.openerp.com.")
- msg_id = message_obj.schedule_with_attach(cr, uid, user.user_email, [email_to], subject, body, model='', context=context)
+ msg_id = message_obj.schedule_with_attach(cr, uid, user.email, [email_to], subject, body, model='', context=context)
notification_obj.create(cr, uid, {'user_id': result_line.user_id.id, 'message_id': msg_id}, context=context)
def send_emails(self, cr, uid, wizard_data, context=None):
_logger.info('Sending share notifications by email...')
mail_message = self.pool.get('mail.message')
user = self.pool.get('res.users').browse(cr, UID_ROOT, uid)
- if not user.user_email:
+ if not user.email:
raise osv.except_osv(_('Email required'), _('The current user must have an email address configured in User Preferences to be able to send outgoing emails.'))
# TODO: also send an HTML version of this mail
msg_ids = []
for result_line in wizard_data.result_line_ids:
- email_to = result_line.user_id.user_email
+ email_to = result_line.user_id.email
if not email_to:
continue
subject = wizard_data.name
@@ -883,7 +883,7 @@ class share_wizard(osv.TransientModel):
body += "--\n"
body += _("OpenERP is a powerful and user-friendly suite of Business Applications (CRM, Sales, HR, etc.)\n"
"It is open source and can be found on http://www.openerp.com.")
- msg_ids.append(mail_message.schedule_with_attach(cr, uid, user.user_email, [email_to], subject, body, model='share.wizard', context=context))
+ msg_ids.append(mail_message.schedule_with_attach(cr, uid, user.email, [email_to], subject, body, model='share.wizard', context=context))
# force direct delivery, as users expect instant notification
mail_message.send(cr, uid, msg_ids, context=context)
_logger.info('%d share notification(s) sent.', len(msg_ids))
diff --git a/addons/survey/survey.py b/addons/survey/survey.py
index 0a96d1fde1c..93bd48be30c 100644
--- a/addons/survey/survey.py
+++ b/addons/survey/survey.py
@@ -740,7 +740,7 @@ class survey_request(osv.osv):
if user_id:
user_obj = self.pool.get('res.users')
user = user_obj.browse(cr, uid, user_id, context=context)
- return {'value': {'email': user.user_email}}
+ return {'value': {'email': user.email}}
return {}
survey_request()
diff --git a/addons/survey/wizard/survey_answer.py b/addons/survey/wizard/survey_answer.py
index b3f27ed2970..66098b45fa8 100644
--- a/addons/survey/wizard/survey_answer.py
+++ b/addons/survey/wizard/survey_answer.py
@@ -414,8 +414,8 @@ class survey_question_wiz(osv.osv_memory):
file.close()
os.remove(addons.get_module_resource('survey', 'report') + survey_data.title + ".pdf")
- user_email = user_obj.browse(cr, uid, uid, context).user_email
- resp_email = survey_data.responsible_id and survey_data.responsible_id.user_email or False
+ user_email = user_obj.browse(cr, uid, uid, context).email
+ resp_email = survey_data.responsible_id and survey_data.responsible_id.email or False
if user_email and resp_email:
user_name = user_obj.browse(cr, uid, uid, context=context).name