[FIX] point_of_sale: Avoid errors if quantity is 0.

bzr revid: uco@tinyerp.com-20101006064225-y31cvvd5hxq63opz
This commit is contained in:
uco (Open ERP)
2010-10-06 12:12:25 +05:30
parent bd32a92f91
commit 69ba991732
2 changed files with 3 additions and 1 deletions
+1
View File
@@ -1043,6 +1043,7 @@ class pos_order_line(osv.osv):
tax_amount = 0.0
taxes = [t for t in line.product_id.taxes_id]
if line.qty == 0.0:
res[line.id][f] = 0.0
continue
computed_taxes = account_tax_obj.compute_all(cr, uid, taxes, line.price_unit, line.qty)['taxes']
for tax in computed_taxes:
+2 -1
View File
@@ -209,7 +209,8 @@ class pos_return(osv.osv_memory):
'date': date_cur,
'date_planned': date_cur
})
line_obj.copy(cr, uid, line.id, {'qty': -qty, 'order_id': new_order})
if qty != 0.0:
line_obj.copy(cr, uid, line.id, {'qty': -qty, 'order_id': new_order})
statementl_obj.create(cr, uid, {
'name': 'Refund %s'%order_id.name,
'statement_id': order_id.statement_ids[0].statement_id.id,