Skip to Content
Catalog / ACC · Accounting & Finance / AC Source Discount
AC Source Discount
ac_source_discount

AC Source Discount

Auto-deduct withholding/source discounts at payment time and post them to dedicated accounts

v19.0.0.0 Abdelfatah Mohammad (AlshayebCo) Accounting & Finance Application

Adds two new models, ac.source.discount.percentage (percentage with 0-1 constraint and auto-named label) and ac.source.discount.type (named type), both with chatter/activity/portal mixins. Inherits contact (default percentage, type, expiry), company and settings (source_discount_receivable_id / source_discount_payable_id accounts), journal item (a source_discount Boolean flag), payment and the payment registration wizard (base_amount, source_discount_id, source_discount_type_id, source_discount_expire_date, computed source_discount_amount). On payment, _onchange_source_discount pulls the partner defaults for inbound/outbound types when not expired; _prepare_move_line_default_vals reduces the liquidity line and appends a flagged withholding line to the configured account; _synchronize_to_moves and _get_trigger_fields_to_synchronize keep draft moves in sync while skipping posted ones. The wizard re-runs the computation via a compute_source context flag on _create_payments.

Overview

Many businesses must withhold a fixed percentage (such as withholding tax or a source-based discount) from a customer or vendor payment and book that amount separately from the cash received or paid. This module lets you define reusable discount percentages and discount types, attach them to a partner with an expiry date, and then have the deduction applied automatically when a payment is registered. The withheld amount is calculated from a configurable base, carved out of the liquidity line, and posted to company-level receivable or payable accounts you set in Settings, so the bank movement and the withholding entry are kept clean and auditable.

Key Features

  • Define reusable source-discount percentages (validated to stay between 0% and 100%) with an auto-generated label.
  • Define named source-discount types so each deduction is clearly categorized on the journal entry line.
  • Assign a default discount percentage, type, and expiry date to any partner, with full change tracking.
  • Auto-populate the discount on inbound and outbound payments from the partner when its expiry date has not passed.
  • Compute the withheld amount from a configurable base amount (or the payment amount when no base is given).
  • Carve the discount out of the liquidity line and add a separate, flagged journal entry line for the withholding.
  • Route the deduction to a company-level receivable account (inbound) or payable account (outbound) set in Settings.
  • Apply the same discount logic through the Register Payment wizard so batch payments stay consistent.
  • Guard against missing setup by blocking the discount when the receivable/payable accounts are not configured.
  • Keep posted moves untouched and re-synchronize draft payment moves when the discount changes.

Technical Details

Technical Name ac_source_discount
Version 19.0.0.0
License OPL-1
Domain ACC · Accounting & Finance

Menu Structure

Source Discount
Source Discount Percentage
Source Discount Type

Security

Two configuration models (discount percentages and discount types) are readable by every internal user, while create, edit, and delete rights are restricted to Settings administrators (the Odoo Administration/Settings group). The Source Discount configuration menus are further limited to Accounting managers and system administrators.

Settings / System Administrator (base.group_system) — full management of discount percentages and types All internal users — read-only access to discount percentages and types Accounting Manager (account.group_account_manager) — visibility of the Source Discount configuration menus

Dependencies

sale purchase account_accountant