Skip to content

Commit

Permalink
[FIX] account_invoice_pricelist call _fix_tax_included_price
Browse files Browse the repository at this point in the history
  • Loading branch information
legalsylvain committed Jul 10, 2019
1 parent e63bb39 commit a0f0477
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions account_invoice_pricelist/model/account_invoice_line.py
Expand Up @@ -57,6 +57,17 @@ def product_id_change(
else:
pricedict = pricelist.price_get(product.id, qty, partner_id)
price_unit = pricedict[pricelist_id]

# Call _fix_tax_included_price to handled correcty fiscal position
if type in ('out_invoice', 'out_refund'):
taxes = product.taxes_id
else:
taxes = product.supplier_taxes_id

price_unit = self.env['account.tax']._fix_tax_included_price(
price_unit, taxes, values['invoice_line_tax_id'])

# Apply currency algorithm
if currency_id:
company = self.env['res.company'].browse(company_id)
currency = self.env['res.currency'].browse(currency_id)
Expand Down

0 comments on commit a0f0477

Please sign in to comment.