double tax deduction because of missing fiscal position mappings

Open Beginner friendly
#1,383 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
69/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
python
Domain
backend

Research direction

Start in the website_sale_b2x_alt_price module and locate product.template's _get_prices method, where the issue says taxes are mapped using the partner's fiscal position. Check the website fiscal position and company used for that calculation, then reproduce the listed local pricelist and EU portal user scenario. Done means the net price is calculated correctly without removing tax twice.

Written by the indexing model from the issue text.

Description

bug

Module

website_sale_b2x_alt_price

Describe the bug

if you have multiple pricelists especially with different tax applications and/or users from different trx authorities (e.g. OSS) prices are incorrect

To Reproduce

all

Steps to reproduce the behavior:

  1. pricelist in local
  2. portal user from other eu country than company - so it should get VAT 0%
  3. proces will gave net price too low - double tax removal

Expected behavior
net price to be properly calculated

Additional context

actual product.template in _get_prices is using taxes from partner, excluding tax remapping

        taxes = partner.property_account_position_id.map_tax(
            product.sudo().taxes_id.filtered(lambda x: x.company_id == company_id)
        ).with_context(force_price_include=alt_field == "total_excluded")

this should become:

taxes = (
    website.fiscal_position_id.sudo()
        .map_tax(product.sudo().taxes_id.filtered(
                 lambda tax_id: tax_id.company_id == website_id.company_id)
            ).with_context(force_price_include=alt_field == 'total_excluded')
        )
Dominant language
HTML
Stars
206
Forks
578
Avg merge
2d 17h
Merged PRs (30d)
15

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from OCA/e-commerce

All issues in OCA/e-commerce

Similar issues

More Backend & API Design issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.