Skip to content

[17.0][PORT] account_payment_partner: add flag to control partner_bank_id without payment mode#4

Closed
felipemotter wants to merge 2 commits into17.0from
17.0-fix-compute-partner-bank-no-payment-mode
Closed

[17.0][PORT] account_payment_partner: add flag to control partner_bank_id without payment mode#4
felipemotter wants to merge 2 commits into17.0from
17.0-fix-compute-partner-bank-no-payment-mode

Conversation

@felipemotter
Copy link
Copy Markdown

Summary

Port da feature para 17.0: flag keep_partner_bank_without_payment_mode no res.company.

  • Adiciona campo booleano na empresa que controla se o partner_bank_id é preservado ou limpo quando não há payment mode
  • Default True: mantém o banco auto-selecionado pelo core do Odoo
  • False: limpa o banco (comportamento legado)
  • Inclui view em Settings > Accounting > Customer Payments
  • Testes cobrindo ambos os cenários (flag habilitada/desabilitada) e refund sem payment mode

@felipemotter felipemotter force-pushed the 17.0-fix-compute-partner-bank-no-payment-mode branch from a5312ac to e16386e Compare February 17, 2026 10:47
@felipemotter felipemotter changed the title [17.0][IMP] account_payment_partner: add flag to control partner_bank_id without payment mode [17.0][PORT] account_payment_partner: add flag to control partner_bank_id without payment mode Feb 17, 2026
…thout payment mode

Add a company-level setting keep_partner_bank_without_payment_mode
(default True) that controls whether partner_bank_id is preserved or
cleared when no payment mode is set on an invoice.

When enabled (default), invoices without a payment mode keep the bank
account auto-selected by Odoo core. When disabled, the bank account is
cleared (legacy behavior).

This resolves the long-standing disagreement in OCA#1418
by letting each company choose the behavior that fits their workflow.
Update test_onchange_payment_mode_id to reflect the new default
behavior (flag=True keeps bank account).

Add test_no_payment_mode_clears_bank_when_flag_disabled to verify
that disabling the flag restores the legacy clearing behavior.

Add test_refund_no_payment_mode_preserves_partner_bank to verify
that refunds without payment mode preserve the bank account.
@felipemotter felipemotter force-pushed the 17.0-fix-compute-partner-bank-no-payment-mode branch from e16386e to 20d05d5 Compare February 17, 2026 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant