Odoo Mindscape. Understand Odoo faster. Explore modules, fields, dependencies and version differences in one place instead of digging through the source code.

Module: Thai Localization - VAT and Withholding Tax

Entity: account.withholding.tax

Compute Method: _compute_pit_id

Inputs Method Outputs
pit_date = self.env.context.get("pit_date") or fields.Date.context_today(self)
pit = self.env["personal.income.tax"].search(
            [("effective_date", "<=", pit_date)], order="effective_date desc", limit=1
        )
self.update({"pit_id": pit.id})

Back to entity