diff --git a/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py index 76314e1986a..f8c1c3d3149 100644 --- a/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py +++ b/addons/hr_timesheet_invoice/wizard/hr_timesheet_invoice_create.py @@ -115,7 +115,10 @@ class account_analytic_line(osv.osv): else: price = 0.0 - taxes = product.taxes_id + if product.taxes_id: + taxes = product.taxes_id + else: + taxes = product.categ_id.taxes_id tax = fiscal_pos_obj.map_tax(cr, uid, account.partner_id.property_account_position, taxes) account_id = product.product_tmpl_id.property_account_income.id or product.categ_id.property_account_income_categ.id if not account_id: diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py index 690d371e9db..6871f072cfd 100644 --- a/addons/point_of_sale/point_of_sale.py +++ b/addons/point_of_sale/point_of_sale.py @@ -1108,7 +1108,10 @@ class pos_order_line(osv.osv): account_tax_obj = self.pool.get('account.tax') cur_obj = self.pool.get('res.currency') for line in self.browse(cr, uid, ids, context=context): - taxes = line.product_id.taxes_id + if line.product_id.taxes_id: + taxes = line.product_id.taxes_id + else: + taxes = line.product_id.categ_id.taxes_id price = line.price_unit * (1 - (line.discount or 0.0) / 100.0) taxes = account_tax_obj.compute_all(cr, uid, line.product_id.taxes_id, price, line.qty, product=line.product_id, partner=line.order_id.partner_id or False) diff --git a/addons/sale/sale.py b/addons/sale/sale.py index c525ba04df1..ed5ac3d43f6 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -1382,7 +1382,10 @@ class sale_order_line(osv.osv): fpos = fiscal_position and self.pool.get('account.fiscal.position').browse(cr, uid, fiscal_position) or False if update_tax: #The quantity only have changed result['delay'] = (product_obj.sale_delay or 0.0) - result['tax_id'] = self.pool.get('account.fiscal.position').map_tax(cr, uid, fpos, product_obj.taxes_id) + if product_obj.taxes_id: + result['tax_id'] = self.pool.get('account.fiscal.position').map_tax(cr, uid, fpos, product_obj.taxes_id) + else: + result['tax_id'] = self.pool.get('account.fiscal.position').map_tax(cr, uid, fpos, product_obj.categ_id.taxes_id) result.update({'type': product_obj.procure_method}) if not flag: diff --git a/addons/stock/stock.py b/addons/stock/stock.py index b770712429c..7b65cc99847 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -915,9 +915,16 @@ class stock_picking(osv.osv): @return: Taxes Ids for the move line """ if type in ('in_invoice', 'in_refund'): - taxes = move_line.product_id.supplier_taxes_id + if 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: - taxes = move_line.product_id.taxes_id + if product_id.taxes_id: + taxes = move_line.product_id.taxes_id + else: + taxes = move_line.product_id.categ_id.taxes_id + if move_line.picking_id and move_line.picking_id.partner_id and move_line.picking_id.partner_id.id: return self.pool.get('account.fiscal.position').map_tax(