[FIX] sale: don't try to post messages on SO if there is no sale related to an invoice
bzr revid: qdp-launchpad@openerp.com-20130314164413-qv3j3b3tcc4zt6b7
This commit is contained in:
parent
6262548099
commit
513601e641
|
@ -1020,7 +1020,8 @@ class account_invoice(osv.Model):
|
|||
sale_order_obj = self.pool.get('sale.order')
|
||||
res = super(account_invoice, self).confirm_paid(cr, uid, ids, context=context)
|
||||
so_ids = sale_order_obj.search(cr, uid, [('invoice_ids', 'in', ids)], context=context)
|
||||
sale_order_obj.message_post(cr, uid, so_ids, body=_("Invoice paid"), context=context)
|
||||
if so_ids:
|
||||
sale_order_obj.message_post(cr, uid, so_ids, body=_("Invoice paid"), context=context)
|
||||
return res
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
Loading…
Reference in New Issue