From 1f5c37ee327989ca148f5c870f8551048eaa8698 Mon Sep 17 00:00:00 2001 From: "sbh (Open ERP)" Date: Fri, 18 Jun 2010 18:30:16 +0530 Subject: [PATCH] [Fix] point_of_sale: Fix the probelm of pos_invoice report bzr revid: sbh@tinyerp.com-20100618130016-1ju5vaswv3awc7oh --- addons/point_of_sale/report/pos_invoice.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/addons/point_of_sale/report/pos_invoice.py b/addons/point_of_sale/report/pos_invoice.py index ee905ed74bf..eb59548758c 100644 --- a/addons/point_of_sale/report/pos_invoice.py +++ b/addons/point_of_sale/report/pos_invoice.py @@ -35,19 +35,19 @@ class pos_invoice(report_sxw.rml_parse): }) - def set_context(self, objects, data, ids, report_type=None): - super(pos_invoice, self).set_context(objects, data, ids, report_type) + def set_context(self, order, data, ids, report_type=None): + super(pos_invoice, self).set_context(order, data, ids, report_type) iids = [] nids = [] - for order in objects: - order.write({'nb_print': order.nb_print + 1}) - if order.invoice_id and order.invoice_id not in iids: - if not order.invoice_id: - raise osv.except_osv(_('Error !'), _('Please create an invoice for this sale.')) - iids.append(order.invoice_id) - nids.append(order.invoice_id.id) + order.write({'nb_print': order.nb_print + 1}) + + if order.invoice_id and order.invoice_id not in iids: + if not order.invoice_id: + raise osv.except_osv(_('Error !'), _('Please create an invoice for this sale.')) + iids.append(order.invoice_id) + nids.append(order.invoice_id.id) self.cr.commit() data['ids'] = nids self.datas = data