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

Module: Thailand - Accounting

Entity: res.partner

Compute Method: _compute_l10n_th_branch_name

View 17.0 View 18.0
Inputs Method Outputs
  • is_company
  • country_code
  • company_registry
for partner in self:
            if not partner.is_company or partner.country_code != 'TH':
                partner.l10n_th_branch_name = ""
            else:
                code = partner.company_registry
-                 partner.l10n_th_branch_name = f"Branch {code}" if code else "Headquarter"
+                 partner.l10n_th_branch_name = partner.env._("Branch %(code)s", code=code) if code else partner.env._(
+                     "Headquarter")
  • l10n_th_branch_name

Back to entity