19.0 vanilla

This commit is contained in:
Ernad Husremovic 2026-03-09 09:31:21 +01:00
parent 7dc55599c6
commit 7f43bbbfcc
650 changed files with 45260 additions and 33436 deletions

View file

@ -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")