Skip to content

Commit 8e6cc3a

Browse files
[REF] addons: propagated change about context_lang and context_tz.
bzr revid: [email protected]
1 parent 8afd274 commit 8e6cc3a

File tree

5 files changed

+19
-19
lines changed

5 files changed

+19
-19
lines changed

addons/base_calendar/base_calendar.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ def _compute_data(self, cr, uid, ids, name, arg, context=None):
245245
continue
246246
else:
247247
result[id][name] = self._get_address(attdata.sent_by_uid.name, \
248-
attdata.sent_by_uid.user_email)
248+
attdata.sent_by_uid.email)
249249

250250
if name == 'cn':
251251
if attdata.user_id:
@@ -289,7 +289,7 @@ def _compute_data(self, cr, uid, ids, name, arg, context=None):
289289

290290
if name == 'language':
291291
user_obj = self.pool.get('res.users')
292-
lang = user_obj.read(cr, uid, uid, ['context_lang'], context=context)['context_lang']
292+
lang = user_obj.read(cr, uid, uid, ['lang'], context=context)['lang']
293293
result[id][name] = lang.replace('_', '-')
294294

295295
return result
@@ -434,7 +434,7 @@ def ics_datetime(idate, short=False):
434434
if not organizer:
435435
organizer = event_obj.user_id
436436
event_org.params['CN'] = [organizer.name]
437-
event_org.value = 'MAILTO:' + (organizer.user_email or organizer.name)
437+
event_org.value = 'MAILTO:' + (organizer.email or organizer.name)
438438

439439
if event_obj.alarm_id:
440440
# computes alarm data
@@ -535,7 +535,7 @@ def onchange_user_id(self, cr, uid, ids, user_id, *args, **argv):
535535
return {'value': {'email': ''}}
536536
usr_obj = self.pool.get('res.users')
537537
user = usr_obj.browse(cr, uid, user_id, *args)
538-
return {'value': {'email': user.user_email, 'availability':user.availability}}
538+
return {'value': {'email': user.email, 'availability':user.availability}}
539539

540540
def do_tentative(self, cr, uid, ids, context=None, *args):
541541
""" Makes event invitation as Tentative
@@ -891,9 +891,9 @@ def do_run_scheduler(self, cr, uid, automatic=False, use_new_cursor=False, \
891891
892892
""" % (alarm.name, alarm.trigger_date, alarm.description, \
893893
alarm.user_id.name, alarm.user_id.signature)
894-
mail_to = [alarm.user_id.user_email]
894+
mail_to = [alarm.user_id.email]
895895
for att in alarm.attendee_ids:
896-
mail_to.append(att.user_id.user_email)
896+
mail_to.append(att.user_id.email)
897897
if mail_to:
898898
mail_message.schedule_with_attach(cr, uid,
899899
tools.config.get('email_from', False),
@@ -947,7 +947,7 @@ def onchange_dates(self, cr, uid, ids, start_date, duration=False, end_date=Fals
947947
value['duration'] = duration
948948
# change start_date's time to 00:00:00 in the user's timezone
949949
user = self.pool.get('res.users').browse(cr, uid, uid)
950-
tz = pytz.timezone(user.context_tz) if user.context_tz else pytz.utc
950+
tz = pytz.timezone(user.tz) if user.tz else pytz.utc
951951
start = pytz.utc.localize(start).astimezone(tz) # convert start in user's timezone
952952
start = start.replace(hour=0, minute=0, second=0) # change start's time to 00:00:00
953953
start = start.astimezone(pytz.utc) # convert start back to utc
@@ -1097,8 +1097,8 @@ def default_organizer(self, cr, uid, context=None):
10971097
user_pool = self.pool.get('res.users')
10981098
user = user_pool.browse(cr, uid, uid, context=context)
10991099
res = user.name
1100-
if user.user_email:
1101-
res += " <%s>" %(user.user_email)
1100+
if user.email:
1101+
res += " <%s>" %(user.email)
11021102
return res
11031103

11041104
_defaults = {

addons/base_calendar/wizard/base_calendar_invite_attendee.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,12 @@ def do_invite(self, cr, uid, ids, context=None):
9999
user = user_obj.browse(cr, uid, user_id)
100100
res = {
101101
'user_id': user_id,
102-
'email': user.user_email
102+
'email': user.email
103103
}
104104
res.update(ref)
105105
vals.append(res)
106-
if user.user_email:
107-
mail_to.append(user.user_email)
106+
if user.email:
107+
mail_to.append(user.email)
108108

109109
elif type == 'external' and datas.get('email'):
110110
res = {'email': datas['email']}
@@ -143,7 +143,7 @@ def do_invite(self, cr, uid, ids, context=None):
143143
self._columns['type'].selection))
144144
raise osv.except_osv(_('Error!'), _("%s must have an email address to send mail.") %(name[0]))
145145
att_obj._send_mail(cr, uid, attendees, mail_to, \
146-
email_from = current_user.user_email or tools.config.get('email_from', False))
146+
email_from = current_user.email or tools.config.get('email_from', False))
147147

148148
return {'type': 'ir.actions.act_window_close'}
149149

addons/base_setup/base_setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class specify_partner_terminology(osv.osv_memory):
5050
def make_translations(self, cr, uid, ids, name, type, src, value, res_id=0, context=None):
5151
trans_obj = self.pool.get('ir.translation')
5252
user_obj = self.pool.get('res.users')
53-
context_lang = user_obj.browse(cr, uid, uid, context=context).context_lang
53+
context_lang = user_obj.browse(cr, uid, uid, context=context).lang
5454
existing_trans_ids = trans_obj.search(cr, uid, [('name','=',name), ('lang','=',context_lang), ('type','=',type), ('src','=',src), ('res_id','=',res_id)])
5555
if existing_trans_ids:
5656
trans_obj.write(cr, uid, existing_trans_ids, {'value': value}, context=context)

addons/import_sugarcrm/import_sugarcrm.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -877,7 +877,7 @@ def import_user(self, val):
877877
else:
878878
val['password'] = 'sugarcrm' #default password for all user #TODO needed in documentation
879879

880-
val['context_lang'] = self.context.get('lang','en_US')
880+
val['lang'] = self.context.get('lang','en_US')
881881
return val
882882

883883
def get_users_department(self, val):
@@ -895,10 +895,10 @@ def get_user_mapping(self):
895895
'map' : {
896896
'name': concat('first_name', 'last_name'),
897897
'login': value('user_name', fallback='last_name'),
898-
'context_lang' : 'context_lang',
898+
'lang' : 'context_lang',
899899
'password' : 'password',
900900
'.id' : '.id',
901-
'user_email' : 'email1',
901+
'email' : 'email1',
902902
}
903903
}
904904

@@ -964,7 +964,7 @@ class import_sugarcrm(osv.osv):
964964
}
965965

966966
def _get_email_id(self, cr, uid, context=None):
967-
return self.pool.get('res.users').browse(cr, uid, uid, context=context).user_email
967+
return self.pool.get('res.users').browse(cr, uid, uid, context=context).email
968968

969969
def _module_installed(self, cr, uid, model, context=None):
970970
module_id = self.pool.get('ir.module.module').search(cr, uid, [('name', '=', model), ('state', "=", "installed")], context=context)

addons/project_timesheet/test/worktask_entry_to_timesheetline_entry.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
-
44
!record {model: res.users, id: res_users_hrmanager0}:
55
company_id: base.main_company
6-
context_lang: en_US
6+
lang: en_US
77
login: hr
88
name: HR Manager
99
password: hr

0 commit comments

Comments
 (0)