<?xml version="1.0" encoding="utf-8" ?>
<!--
  Copyright 2017-2020 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="transmit_method_form" model="ir.ui.view">
        <field name="model">transmit.method</field>
        <field name="arch" type="xml">
            <form>
                <sheet>
                    <widget
                        name="web_ribbon"
                        title="Archived"
                        bg_color="bg-danger"
                        invisible="active"
                    />
                    <div class="oe_title">
                        <label for="name" />
                        <h1>
                            <field name="name" />
                        </h1>
                    </div>
                    <group name="main">
                        <group name="info">
                            <field name="code" />
                        </group>
                        <group name="options">
                            <field name="customer_ok" widget="boolean_toggle" />
                            <field name="supplier_ok" widget="boolean_toggle" />
                        </group>
                    </group>
                </sheet>
            </form>
        </field>
    </record>
    <record id="transmit_method_tree" model="ir.ui.view">
        <field name="model">transmit.method</field>
        <field name="arch" type="xml">
            <list>
                <field name="sequence" widget="handle" />
                <field name="name" />
                <field name="code" />
                <field name="customer_ok" widget="boolean_toggle" />
                <field name="supplier_ok" widget="boolean_toggle" />
                <field name="active" column_invisible="True" />
            </list>
        </field>
    </record>
    <record id="transmit_method_search" model="ir.ui.view">
        <field name="model">transmit.method</field>
        <field name="arch" type="xml">
            <search>
                <field
                    name="name"
                    filter_domain="['|', ('name', 'ilike', self), ('code', 'ilike', self)]"
                    string="Name or Code"
                />
                <filter
                    name="customer_ok"
                    string="Selectable on Customers"
                    domain="[('customer_ok', '=', True)]"
                />
                <filter
                    name="supplier_ok"
                    string="Selectable on Vendors"
                    domain="[('supplier_ok', '=', True)]"
                />
                <separator />
                <filter
                    name="active"
                    string="Archived"
                    domain="[('active', '=' ,False)]"
                />
            </search>
        </field>
    </record>
    <record id="transmit_method_action" model="ir.actions.act_window">
        <field name="name">Transmit Methods</field>
        <field name="res_model">transmit.method</field>
        <field name="view_mode">list,form</field>
    </record>
    <menuitem
        id="transmit_method_menu"
        action="transmit_method_action"
        parent="account.account_management_menu"
        sequence="100"
    />
</odoo>
