[IMP] purchase,sale: use full map_tax signature

Some call signatures have not been aligned with the taxes/product/partner
signature
introduced by the tax cloud module and necesary by some localization modules

Closes #23334
Fixes #23333
This commit is contained in:
David Arnold
2018-02-27 17:35:26 +01:00
committed by Martin Trigaux
parent cc10778927
commit 56eead8356
4 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -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,
+1 -1
View File
@@ -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)
@@ -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}
+1 -1
View File
@@ -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