<?xml version="1.0" encoding="utf-8"?>
<odoo>
        <record id="res_company_form_l10n_fr" model="ir.ui.view">
            <field name="name">res.company.form.l10n.fr</field>
            <field name="model">res.company</field>
            <field name="priority">20</field>
            <field name="inherit_id" ref="account.view_company_form"/>
            <field name="arch" type="xml">
            <data>
                 <xpath expr="//field[@name='company_registry']" position="after">
                    <field name="siret" invisible="country_code != 'FR'"/>
                    <field name="ape" invisible="country_code != 'FR'"/>
                 </xpath>
            </data>
            </field>
        </record>

        <record id="res_partner_form_l10n_fr" model="ir.ui.view">
            <field name="name">res.partner.form.l10n.fr</field>
            <field name="model">res.partner</field>
            <field name="priority">20</field>
            <field name="inherit_id" ref="account.view_partner_property_form"/>
            <field name="arch" type="xml">
            <data>
                 <xpath expr="//field[@name='ref']" position="after">
                    <field name="siret" invisible="'FR' not in fiscal_country_codes or not is_company"/>
                 </xpath>
            </data>
            </field>
        </record>
</odoo>
