Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][FIX] l10n_th_account_tax: create wht move only for journal item with a wht id #478

Open
wants to merge 1 commit into
base: 16.0
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion l10n_th_account_tax/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading