[IMP] purchase : Improved the code to get the invoice lines at first time when we create the invoice.

bzr revid: mdi@tinyerp.com-20120305121642-781krexsohokecfn
This commit is contained in:
Divyesh Makwana (Open ERP) 2012-03-05 17:46:42 +05:30
parent 314f9586d0
commit 5c6efbd235
1 changed files with 2 additions and 1 deletions

View File

@ -283,8 +283,9 @@ class purchase_order(osv.osv):
if not po.invoice_ids:
context.update({'active_ids' : [line.id for line in po.order_line]})
wizard_obj.makeInvoices(cr, uid, [], context=context)
for po in self.browse(cr, uid, ids, context=context):
inv_ids+= [invoice.id for invoice in po.invoice_ids]
res = mod_obj.get_object_reference(cr, uid, 'account', 'invoice_supplier_form')
res_id = res and res[1] or False