[IMP]Tax fix related to stock and pos

bzr revid: dhr@tinyerp.com-20120823071044-aonyui4dq2li8xnj
This commit is contained in:
Dharti Ratani (OpenERP)
2012-08-23 12:40:44 +05:30
parent 73025425f0
commit 39ac8404ff
2 changed files with 7 additions and 8 deletions
+5 -6
View File
@@ -967,10 +967,7 @@ class pos_order(osv.osv):
for line in order.lines:
tax_amount = 0
if line.product_id.taxes_id:
taxes = [t for t in line.product_id.taxes_id]
else:
taxes = [t for t in line.product_id.categ_id.taxes_id]
taxes = [t for t in line.product_id.taxes_id]
computed_taxes = account_tax_obj.compute_all(cr, uid, taxes, line.price_unit * (100.0-line.discount) / 100.0, line.qty)['taxes']
for tax in computed_taxes:
@@ -1147,8 +1144,10 @@ class pos_order_line(osv.osv):
cur_obj = self.pool.get('res.currency')
prod = self.pool.get('product.product').browse(cr, uid, product, context=context)
taxes = prod.taxes_id
if prod.taxes_id:
taxes = prod.taxes_id
else:
taxes = prod.categ_id.taxes_id
price = price_unit * (1 - (discount or 0.0) / 100.0)
taxes = account_tax_obj.compute_all(cr, uid, prod.taxes_id, price, qty, product=prod, partner=False)
+2 -2
View File
@@ -915,12 +915,12 @@ class stock_picking(osv.osv):
@return: Taxes Ids for the move line
"""
if type in ('in_invoice', 'in_refund'):
if product_id.supplier_taxes_id:
if move_line.product_id.supplier_taxes_id:
taxes = move_line.product_id.supplier_taxes_id
else:
taxes = move_line.product_id.categ_id.supplier_taxes_id
else:
if product_id.taxes_id:
if move_line.product_id.taxes_id:
taxes = move_line.product_id.taxes_id
else:
taxes = move_line.product_id.categ_id.taxes_id