[FIX] mail: adapt to improved behavior of ir_model_data.get_object()

bzr revid: rco@openerp.com-20140123103425-gaud319o6t1f94qu
This commit is contained in:
Raphael Collet 2014-01-23 11:34:25 +01:00
parent f27237b8dd
commit b37d6e72c1
2 changed files with 5 additions and 5 deletions

View File

@ -165,7 +165,7 @@ class mail_thread(osv.AbstractModel):
def read_followers_data(self, cr, uid, follower_ids, context=None):
result = []
technical_group = self.pool.get('ir.model.data').get_object(cr, uid, 'base', 'group_no_one', context=context, check_existence_and_raise=True)
technical_group = self.pool.get('ir.model.data').get_object(cr, uid, 'base', 'group_no_one', context=context)
for follower in self.pool.get('res.partner').browse(cr, uid, follower_ids, context=context):
is_editable = uid in map(lambda x: x.id, technical_group.users)
is_uid = uid in map(lambda x: x.id, follower.user_ids)
@ -500,8 +500,8 @@ class mail_thread(osv.AbstractModel):
posted = False
for subtype in subtypes:
subtype_rec = self.pool.get('ir.model.data').get_object(cr, uid, subtype.split('.')[0], subtype.split('.')[1], context=context, check_existence_and_raise=False)
if not subtype_rec.exists():
subtype_rec = self.pool.get('ir.model.data').get_object(cr, uid, subtype.split('.')[0], subtype.split('.')[1], context=context, check=False)
if not (subtype_rec and subtype_rec.exists()):
_logger.debug('subtype %s not found' % subtype)
continue
message = format_message(subtype_rec.description if subtype_rec.description else subtype_rec.name, tracked_values)

View File

@ -94,8 +94,8 @@ class publisher_warranty_contract(osv.osv):
# old behavior based on res.log; now on mail.message, that is not necessarily installed
IMD = self.pool['ir.model.data']
user = self.pool['res.users'].browse(cr, SUPERUSER_ID, SUPERUSER_ID)
poster = IMD.get_object(cr, SUPERUSER_ID, 'mail', 'group_all_employees', context=context, check_existence_and_raise=False)
if not poster.exists():
poster = IMD.get_object(cr, SUPERUSER_ID, 'mail', 'group_all_employees', context=context, check=False)
if not (poster and poster.exists()):
if not user.exists():
return True
poster = user