<?xml version="1.0" encoding="utf-8" ?>
<odoo>
    <record id="view_invoice_spread" model="ir.ui.view">
        <field name="model">account.move</field>
        <field name="inherit_id" ref="account.view_move_form" />
        <field name="arch" type="xml">
            <xpath
                expr="//field[@name='invoice_line_ids']/list/field[@name='quantity']"
                position="before"
            >
                <field
                    name="spread_check"
                    column_invisible="1"
                    groups="account.group_account_user,account.group_account_manager"
                />
                <button
                    name="spread_details"
                    type="object"
                    class="btn btn-link"
                    icon="fa-arrow-circle-right"
                    title="Not linked to any spread board"
                    invisible="spread_check != 'unlinked'"
                    groups="account.group_account_user,account.group_account_manager"
                />
                <button
                    name="spread_details"
                    type="object"
                    class="btn btn-success"
                    icon="fa-arrow-circle-right"
                    title="Linked to spread board"
                    invisible="spread_check != 'linked'"
                    groups="account.group_account_user,account.group_account_manager"
                />
            </xpath>
            <xpath
                expr="//field[@name='line_ids']/list//button[@name='action_automatic_entry']"
                position="after"
            >
                <field
                    name="spread_check"
                    column_invisible="1"
                    groups="account.group_account_user,account.group_account_manager"
                />
                <button
                    name="spread_details"
                    type="object"
                    class="btn btn-success"
                    icon="fa-arrow-circle-right"
                    title="Linked to spread board"
                    groups="account.group_account_user,account.group_account_manager"
                    invisible="spread_check != 'linked'"
                    column_invisible="parent.move_type == 'entry' or parent.state != 'posted'"
                />
            </xpath>
        </field>
    </record>
    <record id="action_account_moves_all_spread" model="ir.actions.act_window">
        <field name="context">{'journal_type':'general', 'search_default_group_by_move': 0, 'search_default_posted':1, 'name_groupby':1}</field>
        <field name="name">Journal Items</field>
        <field name="res_model">account.move.line</field>
        <field name="domain">[('display_type', 'not in', ('line_section', 'line_note'))]</field>
        <field name="view_id" ref="account.view_move_line_tree" />
        <field name="view_mode">list,pivot,graph,form,kanban</field>
    </record>
</odoo>
