[FIX] point_of_sale: Avoid errors if quantity is 0.
bzr revid: uco@tinyerp.com-20101006064225-y31cvvd5hxq63opz
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user