[FIX] point_of_sale: invoicing in the pos printed the wrong order due to a mismatch between order ids and invoice ids
This commit is contained in:
parent
57fe94b34e
commit
221b746c7f
|
@ -32,9 +32,11 @@ class PosInvoiceReport(osv.AbstractModel):
|
|||
report = report_obj._get_report_from_name(cr, uid, 'account.report_invoice')
|
||||
selected_orders = posorder_obj.browse(cr, uid, ids, context=context)
|
||||
|
||||
ids_to_print = []
|
||||
invoiced_posorders_ids = []
|
||||
for order in selected_orders:
|
||||
if order.invoice_id:
|
||||
ids_to_print.append(order.invoice_id.id)
|
||||
invoiced_posorders_ids.append(order.id)
|
||||
|
||||
not_invoiced_orders_ids = list(set(ids) - set(invoiced_posorders_ids))
|
||||
|
@ -44,7 +46,7 @@ class PosInvoiceReport(osv.AbstractModel):
|
|||
raise osv.except_osv(_('Error!'), _('No link to an invoice for %s.' % ', '.join(not_invoiced_orders_names)))
|
||||
|
||||
docargs = {
|
||||
'doc_ids': ids,
|
||||
'doc_ids': ids_to_print,
|
||||
'doc_model': report.model,
|
||||
'docs': selected_orders,
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue