diff --git a/addons/account_followup/account_followup.py b/addons/account_followup/account_followup.py index 3e6f3e5a4e7..dce4c7b3561 100644 --- a/addons/account_followup/account_followup.py +++ b/addons/account_followup/account_followup.py @@ -276,13 +276,14 @@ class res_partner(osv.osv):
Amount due: %s
''' % (total) return followup_table -# def write(self, cr, uid, ids, vals, context=None): -# if vals.get("payment_responsible_id", False): -# for part in self.browse(cr, uid, ids, context=context): -# if part.payment_responsible_id <> vals["payment_responsible_id"]: -# self.message_post(cr, uid, part.id, body = _('New responsible registered: %s'), context=context) -# res = super(res_partner, self).write(cr, uid, ids, vals, context=context) -# return res + def write(self, cr, uid, ids, vals, context=None): + if vals.get("payment_responsible_id", False): + for part in self.browse(cr, uid, ids, context=context): + if part.payment_responsible_id <> vals["payment_responsible_id"]: + self.message_post(cr, uid, part.id, body = _('New responsible registered: %s') % (self.pool.get("res.users").browse(cr, uid, vals["payment_responsible_id"], context=context).name), + context=context) + res = super(res_partner, self).write(cr, uid, ids, vals, context=context) + return res def action_done(self, cr, uid, ids, context=None): return self.write(cr, uid, ids, {'payment_next_action_date': False, 'payment_next_action':'', 'payment_responsible_id': False, 'payment_no_email': False}, context=context)