bzr revid: mra@mra-laptop-20101008061309-k8yfv27lvhhrgoc7
This commit is contained in:
Mustufa Rangwala 2010-10-08 11:43:09 +05:30
parent 0943553c4d
commit d7e360158f
5 changed files with 16 additions and 16 deletions

View File

@ -225,7 +225,7 @@ class account_voucher(osv.osv):
if not tax[0].price_include:
for tax_line in tax_pool.compute_all(cr, uid, tax, voucher_amount, 1).get('taxes',[]):
total_tax += tax_line.get('amount')
total_tax += tax_line.get('amount', 0.0)
total += total_tax
else:
line_ids2 = []
@ -234,7 +234,7 @@ class account_voucher(osv.osv):
line_tax = 0.0
for tax_line in tax_pool.compute_all(cr, uid, tax, line.untax_amount or line.amount, 1).get('taxes',[]):
line_tax += tax_line.get('amount')
line_tax += tax_line.get('amount', 0.0)
line_total += tax_line.get('price_unit')
total_tax += line_tax
untax_amount = line.untax_amount or line.amount

View File

@ -291,7 +291,7 @@ class auction_lots(osv.osv):
taxes += lot.auction_id.buyer_costs
tax = pt_tax.compute_all(cr, uid, taxes, amount, 1)['taxes']
for t in tax:
result += t['amount']
result += t.get('amount', 0.0)
result += amount
elif name == "seller_price":
if lot.bord_vnd_id.tax_id:
@ -300,7 +300,7 @@ class auction_lots(osv.osv):
taxes += lot.auction_id.seller_costs
tax = pt_tax.compute_all(cr, uid, taxes, amount, 1)['taxes']
for t in tax:
result += t['amount']
result += t.get('amount', 0.0)
result += amount
elif name == "gross_revenue":
if lot.auction_id:

View File

@ -187,7 +187,7 @@ class pos_order(osv.osv):
res[order.id]['amount_tax'])
elif line.qty != 0.0:
for c in tax_obj.compute_all(cr, uid, line.product_id.taxes_id, line.price_unit * (1-(line.discount or 0.0)/100.0), line.qty, line.product_id, line.order_id.partner_id)['taxes']:
val += c['amount']
val += c.get('amount', 0.0)
res[order.id]['amount_tax'] = cur_obj.round(cr, uid, cur, val)
return res

View File

@ -59,7 +59,7 @@ class purchase_order(osv.osv):
for line in order.order_line:
val1 += line.price_subtotal
for c in self.pool.get('account.tax').compute_all(cr, uid, line.taxes_id, line.price_unit, line.product_qty, order.partner_address_id.id, line.product_id.id, order.partner_id)['taxes']:
val += c['amount']
val += c.get('amount', 0.0)
res[order.id]['amount_tax']=cur_obj.round(cr, uid, cur, val)
res[order.id]['amount_untaxed']=cur_obj.round(cr, uid, cur, val1)
res[order.id]['amount_total']=res[order.id]['amount_untaxed'] + res[order.id]['amount_tax']

View File

@ -75,7 +75,7 @@ class sale_order(osv.osv):
context = {}
val = 0.0
for c in self.pool.get('account.tax').compute_all(cr, uid, line.tax_id, line.price_unit * (1-(line.discount or 0.0)/100.0), line.product_uom_qty, line.order_id.partner_invoice_id.id, line.product_id, line.order_id.partner_id)['taxes']:
val += c['amount']
val += c.get('amount', 0.0)
return val
def _amount_all(self, cr, uid, ids, field_name, arg, context=None):