[FIX]purchase: on invoice payment confirmation (during a reconciliation for example), 'invoice paid' is written on the purchase order of the invoice. Traceback when there was several purchase orders associated to the invoices confirmed

bzr revid: dle@openerp.com-20131128110937-gs6ko4djss3ffl3o
This commit is contained in:
Denis Ledoux 2013-11-28 12:09:37 +01:00
parent 8a1a3e996f
commit 361406fab8
1 changed files with 2 additions and 2 deletions

View File

@ -1289,8 +1289,8 @@ class account_invoice(osv.Model):
else:
user_id = uid
po_ids = purchase_order_obj.search(cr, user_id, [('invoice_ids', 'in', ids)], context=context)
if po_ids:
purchase_order_obj.message_post(cr, user_id, po_ids, body=_("Invoice paid"), context=context)
for po_id in po_ids:
purchase_order_obj.message_post(cr, user_id, po_id, body=_("Invoice paid"), context=context)
return res
class account_invoice_line(osv.Model):