<?xml version="1.0" encoding="utf-8"?>
<!--
  Copyright 2021 Akretion France (http://www.akretion.com/)
  @author: Alexis de Lattre <alexis.delattre@akretion.com>
  License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->

<odoo>

    <record id="hr_payroll_structure_type_form" model="ir.ui.view">
        <field name="model">hr.payroll.structure.type</field>
        <field name="arch" type="xml">
            <form>
                <widget name="web_ribbon" title="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/>
                <group name="main">
                    <field name="name"/>
                    <field name="default_resource_calendar_id"/>
                    <field name="active" invisible="1"/>
                    <field name="country_id"/>
                </group>
            </form>
        </field>
    </record>

    <record id="hr_payroll_structure_type_tree" model="ir.ui.view">
        <field name="model">hr.payroll.structure.type</field>
        <field name="arch" type="xml">
            <tree>
                <field name="name"/>
                <field name="default_resource_calendar_id" optional="show"/>
                <field name="country_id"/>
            </tree>
        </field>
    </record>

    <record id="hr_payroll_structure_type_search" model="ir.ui.view">
        <field name="model">hr.payroll.structure.type</field>
        <field name="arch" type="xml">
            <search>
                <field name="name"/>
                <separator/>
                <filter string="Archived" name="inactive" domain="[('active', '=', False)]"/>
                <group name="groupby">
                    <filter name="country_groupby" string="Country" context="{'group_by': 'country_id'}"/>
                </group>
            </search>
        </field>
    </record>

    <record id="hr_payroll_structure_type_action" model="ir.actions.act_window">
        <field name="name">Salary Structure Types</field>
        <field name="res_model">hr.payroll.structure.type</field>
        <field name="view_mode">tree,form</field>
    </record>

    <menuitem
        id="hr_payroll_structure_type_menu"
        action="hr_payroll_structure_type_action"
        parent="hr_contract.menu_human_resources_configuration_contract"
        sequence="10"/>


</odoo>
