odoo/tutorials#1181

Created by Khush Patel (pkhu)

Blocked

label
odoo-dev:19.0-sale-management_discount-pkhu
head
3437c22f77b03fcb076f13d2b0f31065d404fc3c
odoo/tutorials
19.0 #1181 missing r+
master

[ADD] sale_management_discount: recalculate global discount

Task Description -
1. Add multiple products to a Sale Order.
2. Apply a single global discount.
3. When order lines are updated or removed, the discount should automatically recalculate based on the current order lines.
4. If no order lines remain, the global discount should be removed/reset.
5. Handle single global discount only.

  • Created new module global_discount_update with required base files
  • Inherited sale.order.line model to handle order line modifications
  • Implemented ondelete logic to update/remove discount when lines are deleted
  • Overridden write method to recalculate discount when order lines are updated
  • Ensured discount is cleared when no order lines exist

task-5928684