Skip to content

Conversation

@rjaraspearhead
Copy link

@rjaraspearhead rjaraspearhead commented Sep 24, 2025

Is your feature request related to a problem?

Yes. The field move_line_id in account.payment.line is currently showing accounting entries that are in draft or cancelled state.
Additionally, when an account has the reconcile flag enabled, entries from accounts like inventory or bank clearing accounts are displayed, even though they should not be selectable in payments.
This can cause wrong reconciliations and incorrect payment allocations.

Describe the solution you'd like

Restrict the domain of move_line_id so that only posted receivable and payable move lines are shown.

Proposed domain:

[('reconciled','=', False),
 ('account_id.reconcile', '=', True),
 ('parent_state', '=', 'posted'),
 ('account_id.account_type', 'in', ('asset_receivable', 'liability_payable'))]

Describe alternatives you've considered

  • Keeping the current domain: not acceptable since it allows invalid move lines.
  • Filtering only by parent_state='posted': this still allows non-receivable/payable accounts to appear, which is not correct for payments.

Additional context

By restricting the domain to posted receivable/payable move lines, we ensure that only valid customer and vendor entries are selectable, which matches the payment process and avoids reconciliation errors.

@rjaraspearhead
Copy link
Author

Could you please review this PR and share your comments regarding this suggested change? Your feedback will be very helpful to ensure we are aligning with the correct payment line behavior.

@Reyes4711-S73, @JordiMForgeFlow

Copy link
Contributor

@JordiMForgeFlow JordiMForgeFlow left a comment

Choose a reason for hiding this comment

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

makes sense 👍🏼 Could you update commit message to use IMP instead of MOD?

Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

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

Both options are on purpose, as you may add reconcilable lines that are not AR/AP, and you may want to add draft lines to your payment order to prepare them for the future. When trying to reconcile, the system will give an error if the lines continue in draft.

@rjaraspearhead
Copy link
Author

Both options are on purpose, as you may add reconcilable lines that are not AR/AP, and you may want to add draft lines to your payment order to prepare them for the future. When trying to reconcile, the system will give an error if the lines continue in draft.

In that case, would it perhaps be advisable to apply a filter that only excludes lines in the cancelled state?

@rjaraspearhead rjaraspearhead force-pushed the 18.0-mod-account_payment_order branch 2 times, most recently from e8f3529 to 77b006c Compare September 30, 2025 22:07
@rjaraspearhead rjaraspearhead force-pushed the 18.0-mod-account_payment_order branch from 77b006c to 6d1fd75 Compare October 1, 2025 00:27
Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

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

Adding this "not cancel" extra condition is OK

@pedrobaeza pedrobaeza changed the title [18.0][MOD] account_payment_order: Restrict move line domain to posted receivable/payable entries [18.0][MOD] account_payment_order: Restrict move line domain to no show cancel lines Oct 1, 2025
@OCA-git-bot
Copy link
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

@pedrobaeza
Copy link
Member

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

On my way to merge this fine PR!
Prepared branch 18.0-ocabot-merge-pr-1502-by-pedrobaeza-bump-patch, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit b41e5bf into OCA:18.0 Oct 1, 2025
7 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 4e67f88. Thanks a lot for contributing to OCA. ❤️

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants