odoo/tutorials#1181
Created by Khush Patel (pkhu)
Blocked
- Merge method
- Review
-
CI
- ci/style: (runtime 3s)
- ci/tutorial: (runtime 70751s)
- 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_updatewith required base files - Inherited
sale.order.linemodel to handle order line modifications - Implemented
ondeletelogic to update/remove discount when lines are deleted - Overridden
writemethod to recalculate discount when order lines are updated - Ensured discount is cleared when no order lines exist