[IMP] public_budget: Stop the recompute of the retencion in payments.#605
Open
iga-adhoc wants to merge 2 commits into
Open
[IMP] public_budget: Stop the recompute of the retencion in payments.#605iga-adhoc wants to merge 2 commits into
iga-adhoc wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
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
Commandpara 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 | ||
| ] |
e7cfc93 to
71d3856
Compare
90e373a to
28784f9
Compare
28784f9 to
768484a
Compare
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

task-66887