Skip to content

[17.0] sale_fixed_discount: PDF report combines fixed-amount and percentage discount fields incorrectly when both types are used #3770

@kwoychesko

Description

@kwoychesko

Happy to work on this issue myself, but I would love some input from the devs/maintainers to make sure I'm understanding the design intent.

Module

sale_fixed_discount

Describe the bug

When a quotation mixes percentage‐based and fixed‐amount discounts on different lines, the PDF template attempts to render both fields in a single “Discount Amount (%)” column rather than displaying each column separately. However, the reciprocal equivalent of each is not being displayed correctly (i.e. if you apply a % discount, the fixed equivalent is displayed as "0.00" and if you apply a fixed discount the percent equivalent is displayed as "0.00"):

Image

I'm assuming the "0.00" is supposed to be the reciprocal equivalent, but please correct me if I misunderstand the design intent. Also, perhaps this isn't a display issue but a backend calculation issue: is the reciprocal equivalent discount supposed to be calculated/stored when the quotation/order is saved?

To Reproduce

Affected versions: 17.0

Steps to reproduce the behavior:

  1. In a runboat.odoo-community.org instance for sale-workflow, login and enable Discounts in the Sales general settings.
  2. With sale_fixed_discount installed, create a new quotation.
  3. Add two line-items, one with a % discount and one with a fixed discount, for example:
    i. Acoustic Bloc Screens with a unit price of $295 and a 50% discount
    ii. Chair floor protection with a unit price of $12 and a $5 fixed discount
  4. Print the quotation/order to create a PDF. Notice that the combined “Discount Amount (%)” column shows "0.00" for each line's reciprocal equivalent discount.

Expected behavior
The "0.00" was expected to be:

  • $147.50 for the 50% discount
  • 41.67% for the $5 fixed discount

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions