Skip to content

Comments

[ADD] sale_management_discount: recalculate global discount#1181

Draft
pkhu-odoo wants to merge 1 commit intoodoo:19.0from
odoo-dev:19.0-sale-management_discount-pkhu
Draft

[ADD] sale_management_discount: recalculate global discount#1181
pkhu-odoo wants to merge 1 commit intoodoo:19.0from
odoo-dev:19.0-sale-management_discount-pkhu

Conversation

@pkhu-odoo
Copy link

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

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
@robodoo
Copy link

robodoo commented Feb 17, 2026

Pull request status dashboard

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants