[IMP]Tax related fixes in account_invoice,delivery sale and stock ,purchase requistion
bzr revid: dhr@tinyerp.com-20120822131816-g4o83w2ot084wyeo
This commit is contained in:
parent
b4ed7eb4ea
commit
75befda5e8
|
@ -1416,9 +1416,15 @@ class account_invoice_line(osv.osv):
|
|||
result['account_id'] = a
|
||||
|
||||
if type in ('out_invoice', 'out_refund'):
|
||||
taxes = res.taxes_id and res.taxes_id or (a and self.pool.get('account.account').browse(cr, uid, a, context=context).tax_ids or False)
|
||||
if res.taxes_id:
|
||||
taxes = res.taxes_id and res.taxes_id or (a and self.pool.get('account.account').browse(cr, uid, a, context=context).tax_ids or False)
|
||||
else:
|
||||
taxes = res.categ_id.taxes_id and res.categ_id.taxes_id or (a and self.pool.get('account.account').browse(cr, uid, a, context=context).tax_ids or False)
|
||||
else:
|
||||
taxes = res.supplier_taxes_id and res.supplier_taxes_id or (a and self.pool.get('account.account').browse(cr, uid, a, context=context).tax_ids or False)
|
||||
if res.supplier_taxes_id:
|
||||
taxes = res.supplier_taxes_id and res.supplier_taxes_id or (a and self.pool.get('account.account').browse(cr, uid, a, context=context).tax_ids or False)
|
||||
else:
|
||||
taxes = res.categ_id.supplier_taxes_id and res.categ_id.supplier_taxes_id or (a and self.pool.get('account.account').browse(cr, uid, a, context=context).tax_ids or False)
|
||||
tax_id = fpos_obj.map_tax(cr, uid, fpos, taxes)
|
||||
|
||||
if type in ('in_invoice', 'in_refund'):
|
||||
|
|
|
@ -59,7 +59,10 @@ class sale_order(osv.osv):
|
|||
|
||||
grid = grid_obj.browse(cr, uid, grid_id, context=context)
|
||||
|
||||
taxes = grid.carrier_id.product_id.taxes_id
|
||||
if grid.carrier_id.product_id.taxes_id:
|
||||
taxes = grid.carrier_id.product_id.taxes_id
|
||||
else:
|
||||
taxes = grid.carrier_id.product_id.categ_id.taxes_id
|
||||
fpos = order.fiscal_position or False
|
||||
taxes_ids = acc_fp_obj.map_tax(cr, uid, fpos, taxes)
|
||||
#create the sale order line
|
||||
|
|
|
@ -98,7 +98,10 @@ class stock_picking(osv.osv):
|
|||
account_id = picking.carrier_id.product_id.categ_id\
|
||||
.property_account_income_categ.id
|
||||
|
||||
taxes = picking.carrier_id.product_id.taxes_id
|
||||
if picking.carrier_id.product_id.taxes_id:
|
||||
taxes = picking.carrier_id.product_id.taxes_id
|
||||
else:
|
||||
taxes = picking.carrier_id.product_id.categ_id.taxes_id
|
||||
partner = picking.partner_id or False
|
||||
if partner:
|
||||
account_id = self.pool.get('account.fiscal.position').map_account(cr, uid, partner.property_account_position, account_id)
|
||||
|
|
|
@ -167,7 +167,10 @@ class purchase_requisition(osv.osv):
|
|||
for line in requisition.line_ids:
|
||||
product = line.product_id
|
||||
seller_price, qty, default_uom_po_id, date_planned = self._seller_details(cr, uid, line, supplier, context=context)
|
||||
taxes_ids = product.supplier_taxes_id
|
||||
if product.supplier_taxes_id:
|
||||
taxes_ids = product.supplier_taxes_id
|
||||
else:
|
||||
taxes_ids = product.categ_id.supplier_taxes_id
|
||||
taxes = fiscal_position.map_tax(cr, uid, supplier.property_account_position, taxes_ids)
|
||||
purchase_order_line.create(cr, uid, {
|
||||
'order_id': purchase_id,
|
||||
|
|
Loading…
Reference in New Issue