[IMP] Simple responsible change message

bzr revid: jco@openerp.com-20130121095426-0r0y92trm23bef28
This commit is contained in:
Josse Colpaert 2013-01-21 10:54:26 +01:00
parent 0f5eceb07b
commit 4b2d2b8ccf
1 changed files with 8 additions and 7 deletions

View File

@ -276,13 +276,14 @@ class res_partner(osv.osv):
<center>Amount due: %s </center>''' % (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)