[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:
commit
7b37981a7e
|
@ -163,6 +163,7 @@ class purchase_order(osv.osv):
|
||||||
'state': {
|
'state': {
|
||||||
'purchase.mt_rfq_confirmed': lambda self, cr, uid, obj, ctx=None: obj['state'] == 'confirmed',
|
'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_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 = {
|
_columns = {
|
||||||
|
@ -675,7 +676,7 @@ class purchase_order(osv.osv):
|
||||||
|
|
||||||
def picking_done(self, cr, uid, ids, context=None):
|
def picking_done(self, cr, uid, ids, context=None):
|
||||||
self.write(cr, uid, ids, {'shipped':1,'state':'approved'}, context=context)
|
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
|
return True
|
||||||
|
|
||||||
def copy(self, cr, uid, id, default=None, context=None):
|
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):
|
class account_invoice(osv.Model):
|
||||||
_inherit = 'account.invoice'
|
_inherit = 'account.invoice'
|
||||||
|
|
||||||
def invoice_validate(self, cr, uid, ids, context=None):
|
def invoice_validate(self, cr, uid, ids, context=None):
|
||||||
po_ids = self.pool.get('purchase.order').search(cr,uid,[('invoice_ids','in',ids)],context)
|
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)
|
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)
|
self.pool.get('purchase.order').message_post(cr, uid, po_ids, body=_("Invoice <b>Paid</b>"), context=context)
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
|
||||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -60,6 +60,11 @@
|
||||||
<field name="default" eval="False"/>
|
<field name="default" eval="False"/>
|
||||||
<field name="res_model">purchase.order</field>
|
<field name="res_model">purchase.order</field>
|
||||||
</record>
|
</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>
|
</data>
|
||||||
</openerp>
|
</openerp>
|
||||||
|
|
Loading…
Reference in New Issue