[IMP]: Fix the problem picking id and remove the print statemetn
bzr revid: sbh@tinyerp.com-20100413090128-wyhs5vj1uw2frokr
This commit is contained in:
parent
1f4c65bc2f
commit
c8afb8bc27
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 {}
|
||||
|
|
Loading…
Reference in New Issue