Skip to content

[18.0][ADD] account_analytic_payment - #960

Open
rjaraspearhead wants to merge 1 commit into
OCA:18.0from
rjaraspearhead:18.0-add-account_analytic_payment
Open

[18.0][ADD] account_analytic_payment#960
rjaraspearhead wants to merge 1 commit into
OCA:18.0from
rjaraspearhead:18.0-add-account_analytic_payment

Conversation

@rjaraspearhead

Copy link
Copy Markdown

Module: account_analytic_payment

New module that adds an analytic distribution on account.payment
(inheriting analytic.mixin) and propagates it to the accounting entry.

What it does

  • Adds the Analytic Distribution field on the payment header
    (widget analytic_distribution, under the analytic accounting group).
  • On post, the distribution is written to the counterpart journal item
    (the receivable/payable line, destination_account_id) via an override of
    _prepare_move_counterpart_lines.
  • If no distribution is set on the payment, no journal item is affected.

Why the counterpart line

The receivable/payable line is the meaningful one for downstream analysis and
keeps it consistent with the payment-lines module (which lists receivable /
payable accounts).

Tests

  • Distribution set on the payment lands on the counterpart line and nowhere else.
  • Payment without distribution leaves all journal items clean.

@OCA/accounting-maintainers

@OCA-git-bot OCA-git-bot added series:18.0 mod:account_analytic_payment Module account_analytic_payment labels Aug 17, 2026
@rjaraspearhead

Copy link
Copy Markdown
Author

ping @celm1990

@celm1990 celm1990 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@pedrobaeza @victoralmau, could you please review this? Should this feature be merged here or in the account-payment repository?

@pedrobaeza

Copy link
Copy Markdown
Member

The name should be IMO account_payment_analytic, for following the top-down rationale. It can be here, being analytic related.

Inherit analytic.mixin on account.payment and on the account.payment.register
wizard to set an analytic distribution when creating a payment (standalone or
from an invoice/bill). On post, the distribution is propagated to the
counterpart journal item (the receivable/payable line).
@rjaraspearhead
rjaraspearhead force-pushed the 18.0-add-account_analytic_payment branch from 269c8c1 to 2f50c33 Compare August 19, 2026 21:50
@OCA-git-bot OCA-git-bot added mod:account_payment_analytic Module account_payment_analytic and removed mod:account_analytic_payment Module account_analytic_payment labels Aug 19, 2026
@rjaraspearhead

Copy link
Copy Markdown
Author

The name should be IMO account_payment_analytic, for following the top-down rationale. It can be here, being analytic related.

Rename done

@celm1990

Copy link
Copy Markdown

In this PR, OCA/account-payment#969, a new module with a similar feature is proposed. If this name doesn't conflict with another module, it's OK for me.

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

Labels

mod:account_payment_analytic Module account_payment_analytic series:18.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants