Skip to content

[16.0][ADD] withholding_tax_remittance_kmitl: batch clear WHT payable - #1248

Open
n3n wants to merge 8 commits into
16.0from
16.0-add-wht-batch-clearing
Open

[16.0][ADD] withholding_tax_remittance_kmitl: batch clear WHT payable#1248
n3n wants to merge 8 commits into
16.0from
16.0-add-wht-batch-clearing

Conversation

@n3n

@n3n n3n commented Sep 3, 2026

Copy link
Copy Markdown
Member

Summary

  • New module withholding_tax_remittance_kmitl, depending on finance_kmitl + l10n_th_account_tax, no changes to either.
  • Adds a WHT Remittance document (withholding.tax.remittance): select withholding.tax.cert records for one ภ.ง.ด. form, post a single balanced JE (Dr WHT payable / Cr bank), and durably mark the certs "นำส่งแล้ว" via cert.remittance_id.
  • Extends the WHT cert list/search views (header button, remit-status column, ยังไม่นำส่ง/นำส่งแล้ว filters) purely via inheritance.
  • Includes CONTEXT.md terminology, ADR-0001 (plain JE, no GL reconciliation, by design), and a test suite covering creation validation, posting, cancellation/reversal, and cert-link persistence.

Test plan

  • Install withholding_tax_remittance_kmitl on a test DB and confirm existing WHT cert flows are unaffected
  • Create WHT certs, batch several into a remittance, confirm mixed-form/mixed-account selections raise errors
  • Post the remittance and confirm the JE is balanced and posts, and certs leave "ยังไม่นำส่ง"
  • Cancel a posted remittance and confirm the JE reverses and certs return to "ยังไม่นำส่ง"

n3n added 8 commits September 3, 2026 09:42
Adds a WHT Remittance document that lets an accountant select withholding
tax certificates for one ภ.ง.ด. form and post a single journal entry
(Dr WHT payable / Cr bank) when the office remits the tax to the Revenue
Department, marking those certificates "นำส่งแล้ว" so the รอนำส่ง balance no
longer accumulates unchecked.
… by 'string'

Odoo rejects a translated attribute (string) as an inheritance selector at
module install ("View inheritance may not use attribute 'string' as a
selector"). Anchor the new group-by filter on the sibling filter's name
instead.
…ains

bank_account_id and journal_id both filter on company_id in their domain.
Gating the field itself behind base.group_multi_company made it absent
from the view for single-company installs, which Odoo's view validation
rejects. Keep it always present but invisible instead.
… period and per-cert analytic lines

Fixes 7 review bugs: missing test date fixtures, wrong reversal assertion,
action_cancel wiping cert history without a trace, certs being snatched
across draft remittances, missing copy=False on cert_ids, certs without a
ภ.ง.ด. form slipping past validation, and the cert_ids one2many widget
deleting certificates instead of unlinking them.

Also adds new business requirements: the remittance period (period_month/
period_year) is now a user-entered input validated against certificate
dates, at most one non-cancelled remittance may exist per form per month,
and the clearing journal entry splits into one Dr/Cr line pair per
certificate per analytic distribution (read back from each certificate's
source entry) so both sides of the entry stay attributable.
…ource, book cheque through both bank accounts

A remittance is now also scoped by source_analytic_id (แหล่งเงิน) so the
same form/month can be filed separately per funding source, per ADR-0003.
Certificates with more than one source on their WHT lines are rejected
rather than split. The clearing JE replaces the single bank_account_id with
savings_account_id/current_account_id and books both the cheque (WHT
payable / current account) and the bank's sweep that funds it (current
account / savings account), so each account reconciles against its own
statement.
…nslate to Thai via i18n

Field string=/help=, Selection option labels, button/menu/action names, and
error messages were hardcoded Thai. Convert them to English source text and
move the Thai text into i18n/th.po as translations, so the module follows
the standard Odoo convention of English source + locale .po files instead
of baking one language into the code. Business data lookups (the กรมสรรพากร
partner-name match) and developer comments/docstrings are unaffected.
…th.po

Fill in the remaining untranslated entries (standard mail.thread fields,
selection labels, error messages) so th.po has full Thai coverage instead
of falling back to the English source for anything not touched by the
earlier label-to-English pass.
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.

1 participant