[IMP] Add messages on chatter for PO done & Products received & invoice paid in PO.

bzr revid: bth@tinyerp.com-20130215134615-gp5vb5jy2tb0sl5a
This commit is contained in:
Bhumi Thakkar (Open ERP) 2013-02-15 19:16:15 +05:30
commit 7b37981a7e
2 changed files with 9 additions and 2 deletions

View File

@ -163,6 +163,7 @@ class purchase_order(osv.osv):
'state': {
'purchase.mt_rfq_confirmed': lambda self, cr, uid, obj, ctx=None: obj['state'] == 'confirmed',
'purchase.mt_rfq_approved': lambda self, cr, uid, obj, ctx=None: obj['state'] == 'approved',
'purchase.mt_rfq_done': lambda self, cr, uid, obj, ctx=None: obj['state'] == 'done',
},
}
_columns = {
@ -675,7 +676,7 @@ class purchase_order(osv.osv):
def picking_done(self, cr, uid, ids, context=None):
self.write(cr, uid, ids, {'shipped':1,'state':'approved'}, context=context)
self.message_post(cr, uid, ids, body=_("Product <b>Received.</b>"), context=context)
self.message_post(cr, uid, ids, body=_("Products <b>Received.</b>"), context=context)
return True
def copy(self, cr, uid, id, default=None, context=None):
@ -1192,7 +1193,7 @@ class mail_compose_message(osv.Model):
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)
@ -1205,4 +1206,5 @@ class account_invoice(osv.Model):
self.pool.get('purchase.order').message_post(cr, uid, po_ids, body=_("Invoice <b>Paid</b>"), context=context)
return res
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -60,6 +60,11 @@
<field name="default" eval="False"/>
<field name="res_model">purchase.order</field>
</record>
<record id="mt_rfq_done" model="mail.message.subtype">
<field name="name">Purchase Order Done</field>
<field name="default" eval="False"/>
<field name="res_model">purchase.order</field>
</record>
</data>
</openerp>