<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <record id="res_config_settings_view_form" model="ir.ui.view">
        <field name="name">res.config.settings.view.form.inherit.account.intrastat</field>
        <field name="model">res.config.settings</field>
        <field name="inherit_id" ref="account.res_config_settings_view_form" />
        <field name="arch" type="xml">
            <xpath expr="//setting[@id='intrastat_statistics']" position="inside">
                <div class="content group" invisible="not module_account_intrastat">
                    <div class="row mt8">
                        <label for="intrastat_default_invoice_transaction_code_id" class="col-lg-4 o_light_label" />
                        <div class="col-lg-8">
                            <field name="intrastat_default_invoice_transaction_code_id"/>
                            <span class="fa fa-lg fa-building-o ms-2" title="Values set here are company-specific."/>
                        </div>
                    </div>
                    <div class="row mt8">
                        <label for="intrastat_default_refund_transaction_code_id" class="col-lg-4 o_light_label" />
                        <div class="col-lg-8">
                            <field name="intrastat_default_refund_transaction_code_id"/>
                            <span class="fa fa-lg fa-building-o ms-2" title="Values set here are company-specific."/>
                        </div>
                    </div>
                    <div class="row mt8" invisible="not has_country_regions">
                        <field name="company_country_id" invisible="1"/>
                        <field name="has_country_regions" invisible="1"/>
                        <label for="intrastat_region_id"  class="col-lg-4 o_light_label"/>
                        <div class="col-lg-8">
                            <field name="intrastat_region_id"
                                   context="{'search_view_ref': 'odex30_account_intrastat.view_intrastat_code_restricted_type_search',
                                             'form_view_ref': 'odex30_account_intrastat.view_intrastat_code_restricted_type_form',
                                             'default_type': 'region', 'default_country_id': company_country_id}"
                                   />
                            <span class="fa fa-lg fa-building-o ms-2" title="Values set here are company-specific."/>
                        </div>
                    </div>
                </div>
            </xpath>
        </field>
    </record>
</odoo>
