Debian Codegraph @

addons/l10n_sa_edi/models/res_config_settings.py

raw
1 from odoo import models, fields, api, _
2
3
4 class ResConfigSettings(models.TransientModel):
5 _inherit = 'res.config.settings'
6
7 l10n_sa_api_mode = fields.Selection(related='company_id.l10n_sa_api_mode', readonly=False)
8
9 @api.depends('company_id')
10 def _compute_company_informations(self):
11 super()._compute_company_informations()
12 for record in self:
13 if self.company_id.country_code == 'SA':
14 record.company_informations += _(
15 '\nBuilding Number: %(building_number)s, Plot Identification: %(plot_identification)s\nNeighborhood: %(neighborhood)s',
16 building_number=self.company_id.l10n_sa_edi_building_number,
17 plot_identification=self.company_id.l10n_sa_edi_plot_identification,
18 neighborhood=self.company_id.street2,
19 )