Skip to content

[18.0] sale: Bug when applying discount in a sale.order.line #1300

@mpascuall

Description

@mpascuall

Odoo Version

  • 16.0
  • 17.0
  • 18.0
  • Other (specify)

Steps to Reproduce

  • Discounts must be activated
  • Go to sale order and create a new one.
  • Select a product and apply a discount.
  • Save the changes.
  • Change product quantity and the discount will be setted to 0.
Grabacion-de-pantalla-desde-2025-05-29-12-20-43.mp4

Log Output

Support Ticket

No response

Possible solution: I think that changing this conditional and adding a not before the discount_enabled variable would solve this:
https://github.com/odoo/odoo/blob/18.0/addons/sale/models/sale_order_line.py#L732

In v17 this works checking the discount_policy to see if its without discount:
https://github.com/odoo/odoo/blob/17.0/addons/sale/models/sale_order_line.py#L577

So i think that makes sense.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions