Skip to Content

Localization Flags in Views and QWeb

Use company_l10n_si_accounting for company-dependent presentation on models that expose the field. The flag reference explains company ownership and active-company fallback.

Form views

Fields used in a view expression must be available in that view. This fragment illustrates conditional display inside a journal-entry form extension:

<field name="company_l10n_si_accounting" invisible="1"/>
<group string="Slovenian Accounting" invisible="not company_l10n_si_accounting">
    <field name="invoice_date_received"/>
</group>

The example requires l10n_si_tax_addons, which defines invoice_date_received. An addon loading this fragment must declare that dependency and place it in an appropriate inherited view.

Use field groups and model permissions for restricted information. A visibility expression controls presentation only.

QWeb reports

For a report whose journal-entry record is named o, conditional content can read the company's switch directly:

<t t-if="o.company_id.l10n_si_accounting">
    <p>Slovenian accounting is enabled for this document's company.</p>
</t>

Keep the document company authoritative when printing across companies. Shared partner and product flags can follow the active company, so they do not by themselves identify a document's reporting company.

Selecting report records

Select source records through the ORM with explicit company and reporting criteria. For example, an account selection for one allowed company can use Odoo 18's company_ids relation:

accounts = env["account.account"].search([("company_ids", "in", company.ids)])

Account selection, amount calculation, and report grouping remain the report implementation's responsibility. The localization mixin supplies Boolean company flags; it does not supply account-category lists or financial totals.

For chart-based grouping, see account groups. Return to the technical overview.