summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsbh (Open ERP) <sbh@tinyerp.com>2010-04-13 14:31:28 +0530
committersbh (Open ERP) <sbh@tinyerp.com>2010-04-13 14:31:28 +0530
commitc8afb8bc277ca9c8ff04c594343901ca836cfd7e (patch)
tree72ca443f945d523a81a953a960344e41c73d3ab8
parent1f4c65bc2fe7a44812a5befa89f89ba61ffa8567 (diff)
[IMP]: Fix the problem picking id and remove the print statemetn
bzr revid: sbh@tinyerp.com-20100413090128-wyhs5vj1uw2frokr
-rw-r--r--addons/point_of_sale/report/pos_invoice.py2
-rw-r--r--addons/point_of_sale/report/pos_payment_report.py2
-rw-r--r--addons/point_of_sale/wizard/pos_payment.py12
3 files changed, 10 insertions, 6 deletions
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 {}