account_invoice_triple_discount
This module lets invoices apply up to three successive percentage discounts per line while keeping an accurate total discount.
Key Features
- triple.discount.mixin: Provides fields for three percentage discounts, computes the aggregated total discount, and limits each discount to 100%.
- account.move.line: Inherits the triple discount mixin so invoice lines store successive discounts and auto-handle aggregated totals during create and write operations.
- account.move: Extends the invoice line views to show the three discount fields and relabel the aggregated discount as the total discount.
- account.report_invoice_document: Adds distinct columns for each successive discount on the printed invoice while hiding the original single discount column.
- data migration: The post-init hook copies existing discount values into the first discount field and recalculates aggregated totals for historical invoice lines.