From cc61d467fafac83b9785fd506ae86f2722e28288 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Tue, 19 May 2015 12:51:24 +0200 Subject: [PATCH] [FIX] purchase: validate invoice A user that has the rights in Accounting & Finance equal to Invoicing & Payments must have the right to validate a supplier invoice. opw:634601 --- addons/purchase/purchase.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index 98365546c60..a56813774eb 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -1325,7 +1325,7 @@ class account_invoice(osv.Model): user_id = uid po_ids = purchase_order_obj.search(cr, user_id, [('invoice_ids', 'in', ids)], context=context) wf_service = netsvc.LocalService("workflow") - for order in purchase_order_obj.browse(cr, uid, po_ids, context=context): + for order in purchase_order_obj.browse(cr, user_id, po_ids, context=context): # Signal purchase order workflow that an invoice has been validated. invoiced = [] shipped = True @@ -1338,8 +1338,8 @@ class account_invoice(osv.Model): if all(line.invoice_id.state not in ['draft', 'cancel'] for line in po_line.invoice_lines): invoiced.append(po_line.id) if invoiced and shipped: - self.pool['purchase.order.line'].write(cr, uid, invoiced, {'invoiced': True}) - wf_service.trg_write(uid, 'purchase.order', order.id, cr) + self.pool['purchase.order.line'].write(cr, user_id, invoiced, {'invoiced': True}) + wf_service.trg_write(user_id, 'purchase.order', order.id, cr) return res # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: