From 0558ed61d986a7a8a134e06ddeeb5262fb3346e2 Mon Sep 17 00:00:00 2001 From: Paramjit Singh Sahota Date: Thu, 14 Feb 2013 11:38:46 +0530 Subject: [PATCH] [IMP] Added message post for 'Invoice Received' when the invoice is validated in PO. bzr revid: psa@tinyerp.com-20130214060846-xed5pskiv0cw40tn --- addons/purchase/purchase.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index 357f5b27fd6..e276ce0c48f 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -1188,4 +1188,13 @@ class mail_compose_message(osv.Model): self.pool.get('purchase.order').signal_send_rfq(cr, uid, [context['default_res_id']]) return super(mail_compose_message, self).send_mail(cr, uid, ids, context=context) +class account_invoice(osv.Model): + _inherit = 'account.invoice' + + def invoice_validate(self, cr, uid, ids, context=None): + po_ids = self.pool.get('purchase.order').search(cr,uid,[('invoice_ids','in',ids)],context) + res = super(account_invoice, self).invoice_validate(cr, uid, ids, context=None) + self.pool.get('purchase.order').message_post(cr, uid, po_ids, body=_("Invoice Received."), context=context) + return res + # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: