diff --git a/addons/purchase/models/account_invoice.py b/addons/purchase/models/account_invoice.py index 4847ddf11ee..23ec7d87b0c 100644 --- a/addons/purchase/models/account_invoice.py +++ b/addons/purchase/models/account_invoice.py @@ -42,7 +42,7 @@ class AccountInvoice(models.Model): if float_compare(qty, 0.0, precision_rounding=line.product_uom.rounding) <= 0: qty = 0.0 taxes = line.taxes_id - invoice_line_tax_ids = line.order_id.fiscal_position_id.map_tax(taxes) + invoice_line_tax_ids = line.order_id.fiscal_position_id.map_tax(taxes, line.product_id, line.order_id.partner_id) invoice_line = self.env['account.invoice.line'] data = { 'purchase_line_id': line.id, diff --git a/addons/purchase/models/purchase.py b/addons/purchase/models/purchase.py index 2942428e3af..0e8a070ff00 100644 --- a/addons/purchase/models/purchase.py +++ b/addons/purchase/models/purchase.py @@ -1024,7 +1024,7 @@ class ProcurementRule(models.Model): taxes = product_id.supplier_taxes_id fpos = po.fiscal_position_id - taxes_id = fpos.map_tax(taxes) if fpos else taxes + taxes_id = fpos.map_tax(taxes, product_id, seller.name) if fpos else taxes if taxes_id: taxes_id = taxes_id.filtered(lambda x: x.company_id.id == values['company_id'].id) diff --git a/addons/sale/wizard/sale_make_invoice_advance.py b/addons/sale/wizard/sale_make_invoice_advance.py index 973ea404549..e7c42f92fa3 100644 --- a/addons/sale/wizard/sale_make_invoice_advance.py +++ b/addons/sale/wizard/sale_make_invoice_advance.py @@ -88,7 +88,7 @@ class SaleAdvancePaymentInv(models.TransientModel): del context taxes = self.product_id.taxes_id.filtered(lambda r: not order.company_id or r.company_id == order.company_id) if order.fiscal_position_id and taxes: - tax_ids = order.fiscal_position_id.map_tax(taxes).ids + tax_ids = order.fiscal_position_id.map_tax(taxes, self.product_id, order.partner_shipping_id).ids else: tax_ids = taxes.ids @@ -153,7 +153,7 @@ class SaleAdvancePaymentInv(models.TransientModel): raise UserError(_("The product used to invoice a down payment should be of type 'Service'. Please use another product or update this product.")) taxes = self.product_id.taxes_id.filtered(lambda r: not order.company_id or r.company_id == order.company_id) if order.fiscal_position_id and taxes: - tax_ids = order.fiscal_position_id.map_tax(taxes).ids + tax_ids = order.fiscal_position_id.map_tax(taxes, self.product_id, order.partner_shipping_id).ids else: tax_ids = taxes.ids context = {'lang': order.partner_id.lang} diff --git a/addons/website_sale/models/product.py b/addons/website_sale/models/product.py index 133494dc184..ba95563d790 100644 --- a/addons/website_sale/models/product.py +++ b/addons/website_sale/models/product.py @@ -197,7 +197,7 @@ class Product(models.Model): ret = self.env.user.has_group('sale.group_show_price_subtotal') and 'total_excluded' or 'total_included' for p, p2 in pycompat.izip(self, self2): - taxes = partner.property_account_position_id.map_tax(p.sudo().taxes_id.filtered(lambda x: x.company_id == company_id)) + taxes = partner.property_account_position_id.map_tax(p.sudo().taxes_id.filtered(lambda x: x.company_id == company_id), p, partner) p.website_price = taxes.compute_all(p2.price, pricelist.currency_id, quantity=qty, product=p2, partner=partner)[ret] price_without_pricelist = taxes.compute_all(p.list_price, pricelist.currency_id)[ret] p.website_price_difference = False if float_is_zero(price_without_pricelist - p.website_price, precision_rounding=pricelist.currency_id.rounding) else True