mirror of
https://github.com/bringout/oca-ocb-l10n_asia-pacific.git
synced 2026-04-26 06:22:01 +02:00
19.0 vanilla
This commit is contained in:
parent
7dc55599c6
commit
7f43bbbfcc
650 changed files with 45260 additions and 33436 deletions
|
|
@ -2,15 +2,17 @@
|
|||
# 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="_l10n_th_get_branch_name")
|
||||
l10n_th_branch_name = fields.Char(compute="_compute_l10n_th_branch_name")
|
||||
|
||||
def _l10n_th_get_branch_name(self):
|
||||
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 = 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")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue