<?xml version="1.0" encoding="UTF-8"?>
<odoo>
    <data>

        <record id="certificate_certificate_view_search" model="ir.ui.view">
            <field name="name">certificate_certificate_view_search.inherit.l10n_es_edi_tbai</field>
            <field name="model">certificate.certificate</field>
            <field name="inherit_id" ref="certificate.certificate_certificate_view_search"/>
            <field name="arch" type="xml">
                <filter name="scope_general" position="after">
                    <filter string="TBAI" name="scope_tbai" domain="[('scope','=','tbai')]" help="TBAI certificates"/>
                </filter>
            </field>
        </record>
    
        <record id="l10n_es_edi_tbai_certificate_action" model="ir.actions.act_window">
            <field name="name">Certificates for EDI TicketBAI invoices on Spain</field>
            <field name="res_model">certificate.certificate</field>
            <field name="view_mode">list,form</field>
            <field name="context">{'scope': 'tbai', 'search_default_scope_tbai': 1}</field>
            <field name="help" type="html">
                <p class="oe_view_nocontent_create">Create the first certificate</p>
            </field>
        </record>
    
        <record id="certificate_certificate_view_form" model="ir.ui.view">
            <field name="name">certificate_certificate_view_form.inherit.l10n_es_edi_tbai</field>
            <field name="model">certificate.certificate</field>
            <field name="inherit_id" ref="certificate.certificate_certificate_view_form"/>
            <field name="arch" type="xml">
                <field name="scope" position="attributes">
                    <attribute name="invisible">False</attribute>
                </field>
            </field>
        </record>

        <menuitem id="menu_l10n_es_edi_tbai_root"
                  name="Spain TicketBAI"
                  sequence="110"
                  groups="account.group_account_manager"
                  parent="account.menu_finance_configuration">
            <menuitem id="menu_l10n_es_edi_tbai_certificates"
                      name="Certificates"
                      action="l10n_es_edi_tbai_certificate_action"
                      sequence="100"
                      groups="account.group_account_manager"/>
        </menuitem>

    </data>
</odoo>
