From 07e0889e6c1bbd52d399de056ad0d804cc4e7187 Mon Sep 17 00:00:00 2001 From: Pani-k-folk Date: Mon, 11 Nov 2024 11:41:19 +0700 Subject: [PATCH] [FIX] l10n_th_account_tax: create wht move only for journal item with a wht id --- l10n_th_account_tax/models/account_move.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/l10n_th_account_tax/models/account_move.py b/l10n_th_account_tax/models/account_move.py index e92f3c3c0..17f6c27d1 100644 --- a/l10n_th_account_tax/models/account_move.py +++ b/l10n_th_account_tax/models/account_move.py @@ -545,7 +545,9 @@ def _post(self, soft=True): # but still need to keep track the withholding.move base amount for move in self: # Normal case, create withholding.move only when withholding - wht_moves = move.line_ids.filtered("account_id.wht_account") + wht_moves = move.line_ids.filtered( + lambda l: l.account_id.wht_account and l.wht_tax_id + ) withholding_moves = [ Command.create(self._prepare_withholding_move(wht_move)) for wht_move in wht_moves