[19.0][ADD] account_early_payment_base, account_customer_early_payment_discount: early payment discount granted to customers settled by a credit note task#30881 - #12
Merged
alan196 merged 3 commits intoSep 18, 2026
Conversation
|
Linked to Odoo task #30881 |
…discounts settled by a credit note Both account_supplier_early_payment_discount and the new customer side need the same fields on account.move (last day to pay, discount amount, credit note), the same Apply Early Payment button and the business day helpers of res.company. Defined twice they override each other, so they move here and the extending modules override _get_early_payment_values, _early_payment_can_apply and _early_payment_adjust_credit_note for the move types they handle. A credit note flagged is_early_payment_refund is reconciled with its invoice when posted. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…_payment_base The fields, the button and the business day helpers now come from the base module; this module keeps the supplier terms, the base date on the receipt, the pay date, the posted internal credit note and the follow-up activity. Behaviour unchanged. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… granted to customers settled by a credit note The native early payment discount writes the discount off when the payment is registered, counts calendar days and applies to the whole invoice. This module keeps the percentage and days of the payment terms and settles the discount with a credit note issued once the customer pays in time, optionally counting business days on the working calendar of the company and leaving the services (freight, insurance) out of the discount base. The credit note is created in draft so any approval flow of the company can gate it, and it is reconciled with the invoice when posted. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
alan196
force-pushed
the
19.0-add-account_customer_early_payment_discount
branch
from
September 18, 2026 15:11
88e5364 to
b2a4497
Compare
alan196
deleted the
19.0-add-account_customer_early_payment_discount
branch
September 18, 2026 15:21
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
New module
account_customer_early_payment_discount, on top ofaccount_early_payment_base.Includes
account_early_payment_baseand the refactor ofaccount_supplier_early_payment_discounton top of it (already merged here as #11), mirroring the OCA PRs OCA#978 (base), OCA#976 (supplier) and OCA#977 (customer).Companies that grant their customers a discount for paying within a few days often settle it with a credit note: a fiscal document the customer books and, in countries like Mexico, the only way to report a discount granted after the invoice was issued. The native early payment discount of the payment terms writes the discount off when the payment is registered, counts calendar days and applies the same percentage to the whole invoice.
This module keeps the percentage and the days of the payment terms and adds, on the payment terms:
On the customer invoice: the last day to pay, the amount of the discount, the Early Payment to Apply filter once the customer paid in time, and the Apply Early Payment button, which creates a draft credit note with the eligible lines and their taxes. The credit note is left in draft so any approval flow of the company (for example
account_move_tier_validation) can gate it, and it is reconciled with the invoice as soon as it is posted.account.move._early_payment_paid_on_time()andaccount.move._early_payment_eligible_lines()are the extension points. The fields onaccount.move, the button and the business day helpers live inaccount_early_payment_base, shared withaccount_supplier_early_payment_discount.🤖 Generated with Claude Code