Skip to content

[IMP] public_budget: Stop the recompute of the retencion in payments.#605

Open
iga-adhoc wants to merge 2 commits into
ingadhoc:18.0from
adhoc-dev:18.0-t-66887-iga
Open

[IMP] public_budget: Stop the recompute of the retencion in payments.#605
iga-adhoc wants to merge 2 commits into
ingadhoc:18.0from
adhoc-dev:18.0-t-66887-iga

Conversation

@iga-adhoc

Copy link
Copy Markdown
Contributor

task-66887

Copilot AI review requested due to automatic review settings May 19, 2026 13:00
@roboadhoc

Copy link
Copy Markdown
Contributor

Pull request status dashboard

Copilot AI 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.

Pull request overview

Este PR busca evitar que, al confirmar una orden de pago, se recomputen/modifiquen las líneas de retención (l10n_ar_withholding_line_ids) preservando su estado original durante el confirm().

Changes:

  • Se importa Command para operar con comandos en campos one2many.
  • En confirm(), se “snapshot” de las retenciones antes de cambios de estado y se restauran si detecta diferencias tras confirmar.

Comment on lines +192 to +204
if "l10n_ar_withholding_line_ids" in rec._fields:
current_signature = [
(line.tax_id.id, line.name, line.base_amount, line.amount, line.ref)
for line in rec.l10n_ar_withholding_line_ids
]
original_signature = [
(line["tax_id"], line["name"], line["base_amount"], line["amount"], line["ref"])
for line in original_withholding_vals
]
if current_signature != original_signature:
rec.l10n_ar_withholding_line_ids = [Command.clear()] + [
Command.create(vals) for vals in original_withholding_vals
]
@iga-adhoc iga-adhoc force-pushed the 18.0-t-66887-iga branch 3 times, most recently from 90e373a to 28784f9 Compare June 10, 2026 13:25
Override _compute_l10n_ar_withholding_line_ids to skip recomputation
when dont_recompute_withholdings is set on the fiscal position and
withholding lines already exist. Removes the fragile save/restore
approach from action_post that left accounting entries out of sync.
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.

3 participants