Skip to content

[19.0][FIX] sale_order_type: preserve manual payment term when changing invoice journal#4323

Open
lef-adhoc wants to merge 1 commit into
OCA:19.0from
adhoc-dev:19.0-h-113410-lef
Open

[19.0][FIX] sale_order_type: preserve manual payment term when changing invoice journal#4323
lef-adhoc wants to merge 1 commit into
OCA:19.0from
adhoc-dev:19.0-h-113410-lef

Conversation

@lef-adhoc
Copy link
Copy Markdown
Contributor

It's the same as #4273

When a sale type has no payment_term_id and the user sets a manual term on the sale order, changing the invoice journal triggered a recompute chain (journal_id → company_id → sale_type_id) that caused super() to silently reset invoice_payment_term_id to the partner's default.

Skip the super() call for records where neither the partner nor the sale type changed and the sale type carries no term, so the chosen term is kept. Adds a regression test covering this scenario.

…oice journal

When a sale type has no payment_term_id and the user sets a manual term
on the sale order, changing the invoice journal triggered a recompute
chain (journal_id → company_id → sale_type_id) that caused super() to
silently reset invoice_payment_term_id to the partner's default.

Skip the super() call for records where neither the partner nor the sale
type changed and the sale type carries no term, so the chosen term is
kept. Adds a regression test covering this scenario.
Copy link
Copy Markdown
Contributor

@matiasperalta1 matiasperalta1 left a comment

Choose a reason for hiding this comment

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

LGTM

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants