mirror of
https://github.com/bringout/oca-ocb-l10n_asia-pacific.git
synced 2026-04-25 05:21:59 +02:00
18 lines
686 B
Python
18 lines
686 B
Python
# -*- coding: utf-8 -*-
|
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
from odoo import models, fields
|
|
|
|
|
|
class ResPartner(models.Model):
|
|
_inherit = "res.partner"
|
|
|
|
l10n_th_branch_name = fields.Char(compute="_compute_l10n_th_branch_name")
|
|
|
|
def _compute_l10n_th_branch_name(self):
|
|
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 = partner.env._("Branch %(code)s", code=code) if code else partner.env._(
|
|
"Headquarter")
|