Skip to content

Commit 742b184

Browse files
committed
[FIX] l10n_ar_tax: deletion of withholding lines
closes #1447 X-original-commit: d3b0126 Signed-off-by: Julia Elizondo - jue (#l10n) <jue@adhoc.com.ar>
1 parent ce23266 commit 742b184

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

l10n_ar_tax/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,12 @@
1313

1414
def monkey_patch_synchronize_to_moves():
1515
def _synchronize_to_moves(self, changed_fields):
16-
return super(AccountPayment, self)._synchronize_to_moves(changed_fields)
16+
# dynamic_unlink=True allows deletion of withholding move lines with display_type='tax'
17+
# that are classified as write-off lines by _seek_for_lines. Without it,
18+
# _prevent_automatic_line_deletion raises a ValidationError even in draft state.
19+
# This is safe: _synchronize_to_moves only runs on draft moves (posted are skipped),
20+
# and this is a programmatic sync, not a user UI deletion.
21+
return super(AccountPayment, self.with_context(dynamic_unlink=True))._synchronize_to_moves(changed_fields)
1722

1823
AccountPayment._synchronize_to_moves = _synchronize_to_moves
1924

0 commit comments

Comments
 (0)