Company and Record Localization Flags
res.company.l10n_si_accounting controls whether a company uses Slovenian
accounting behavior. It is defined in res_company.py
and exposed through an editable related field in
res_config_settings.py.
Shared mixin
The abstract model l10n.si.mixin in
l10n_si_mixin.py supplies two read-only, nonstored
Boolean fields:
| Field | Meaning |
|---|---|
company_l10n_si_accounting |
Company switch for conditional display |
is_l10n_si_record |
Compatibility flag mirroring the same company switch |
The mixin reads the record's company switch when company_id is assigned.
Otherwise, it uses record.env.company.l10n_si_accounting. The computes depend
on the active company context and use compute_sudo=True. Shared records can
therefore expose different flags under different company contexts.
l10n_si_mixin_models.py extends accounts, journal entries and items, products, partners, bank accounts, and stock models. Journals inherit the mixin through account_journal.py.
The loaded move and
move-line extensions define
company_l10n_si_accounting as a direct related field to the owning company.
Backend use
Read the owning company's switch for an accounting document:
uses_slovenian_accounting = move.company_id.l10n_si_accounting
For a shared partner, select the intended company context before reading its flag:
uses_slovenian_accounting = partner.with_company(company).company_l10n_si_accounting
These nonstored computed flags have no custom search method. Use stored company fields for ORM search domains, and flags for display or recordset logic. Preserve normal access checks and company record rules.
Journal and menu fields
A journal's l10n_si_fiscal_position_id selection is restricted to that
journal's company.
ir_ui_menu.py defines a separate stored
is_l10n_si_record menu marker. Its meaning differs from the computed mixin
flag. Additional Slovenian hiding applies only when menus_current_company
identifies an existing company whose accounting switch is off. Without that
context, the method returns core-visible menus. Menu visibility does not
authorize access to the underlying models.
Return to the technical overview.