From 4b2d2b8ccfa360bd71d34d8ac47d381e6f157011 Mon Sep 17 00:00:00 2001 From: Josse Colpaert Date: Mon, 21 Jan 2013 10:54:26 +0100 Subject: [PATCH] [IMP] Simple responsible change message bzr revid: jco@openerp.com-20130121095426-0r0y92trm23bef28 --- addons/account_followup/account_followup.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) 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)