From b387836284c86d1e976487a7638d2a821459614e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Wed, 14 Nov 2012 17:30:07 +0100 Subject: [PATCH] [IMP] mail.group: updating the descrpition, also update the description in the params of the client action related to the mail group. bzr revid: tde@openerp.com-20121114163007-91z50xmkepnc436l --- addons/mail/mail_group.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/addons/mail/mail_group.py b/addons/mail/mail_group.py index 73e808daac3..c589b54d4f9 100644 --- a/addons/mail/mail_group.py +++ b/addons/mail/mail_group.py @@ -114,7 +114,7 @@ class mail_group(osv.Model): alias_id = mail_alias.create_unique_alias(cr, uid, # Using '+' allows using subaddressing for those who don't # have a catchall domain setup. - {'alias_name': "group+"+vals['name']}, + {'alias_name': "group+" + vals['name']}, model_name=self._name, context=context) vals['alias_id'] = alias_id @@ -161,6 +161,13 @@ class mail_group(osv.Model): result = super(mail_group, self).write(cr, uid, ids, vals, context=context) if vals.get('group_ids'): self._subscribe_users(cr, uid, ids, context=context) + # if description is changed: update client action + if vals.get('description'): + cobj = self.pool.get('ir.actions.client') + for action in [group.action for group in self.browse(cr, SUPERUSER_ID, ids, context=context) if group.action]: + new_params = action.params + new_params['header_description'] = vals.get('description') + cobj.write(cr, SUPERUSER_ID, [action.id], {'params': str(new_params)}, context=context) return result def action_follow(self, cr, uid, ids, context=None):