diff --git a/addons/point_of_sale/report/pos_invoice.py b/addons/point_of_sale/report/pos_invoice.py index d9f345ca185..ee905ed74bf 100644 --- a/addons/point_of_sale/report/pos_invoice.py +++ b/addons/point_of_sale/report/pos_invoice.py @@ -33,7 +33,7 @@ class pos_invoice(report_sxw.rml_parse): self.localcontext.update({ 'time': time, }) - print + def set_context(self, objects, data, ids, report_type=None): super(pos_invoice, self).set_context(objects, data, ids, report_type) diff --git a/addons/point_of_sale/report/pos_payment_report.py b/addons/point_of_sale/report/pos_payment_report.py index f27add1e208..ceb824cf014 100644 --- a/addons/point_of_sale/report/pos_payment_report.py +++ b/addons/point_of_sale/report/pos_payment_report.py @@ -52,7 +52,7 @@ class pos_payment_report(report_sxw.rml_parse): "where pt.id=pp.product_tmpl_id and pp.id=pol.product_id and po.id = pol.order_id " \ "and po.state in ('paid','invoiced') and to_char(date_trunc('day',po.date_order),'YYYY-MM-DD')::date = current_date") data=self.cr.dictfetchall() - print data + for d in data: self.total += d['price_unit'] * d['qty'] return data diff --git a/addons/point_of_sale/wizard/pos_payment.py b/addons/point_of_sale/wizard/pos_payment.py index c34e7fad9e1..8e25f3f0797 100644 --- a/addons/point_of_sale/wizard/pos_payment.py +++ b/addons/point_of_sale/wizard/pos_payment.py @@ -137,17 +137,21 @@ class pos_make_payment(osv.osv_memory): jrnl_used=jrnl_obj.browse(cr,uid,data['journal']) order_obj.write(cr, uid, [record_id], {'invoice_wanted': invoice_wanted}) order_obj.add_payment(cr, uid, record_id, data, context=context) - - if amount<=0.0: - context.update({'flag':True}) - order_obj.action_paid(cr,uid,[record_id],context) + # Todo need to check +# if amount<=0.0: +# context.update({'flag':True}) +# order_obj.action_paid(cr,uid,[record_id],context) if order_obj.test_paid(cr, uid, [record_id]): if order.partner_id and order.invoice_wanted: return self.create_invoice(cr,uid,ids,context) else: + order_obj.action_paid(cr,uid,[record_id],context) order_obj.write(cr, uid, [record_id],{'state':'paid'}) return self.print_report(cr, uid, ids, context) if order.amount_paid > 0.0: + context.update({'flag': True}) + # Todo need to check + order_obj.action_paid(cr, uid, [record_id], context) self.pool.get('pos.order').write(cr, uid, [record_id],{'state':'advance'}) return self.print_report(cr, uid, ids, context) return {}