<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <record id="buyer_view_form" model="ir.ui.view">
        <field name="name">buyer.form</field>
        <field name="model">buyer</field>
        <field name="arch" type="xml">
            <form string="Buyer">
                <header>
                    <field name="state" widget="statusbar" statusbar_visible="pending,active,suspended"/>
                    <button name="action_create_logto_org" type="object" string="Create Logto Organization"
                            class="btn-primary" invisible="state != 'pending' or logto_org_id"/>
                </header>
                <sheet>
                    <div class="oe_button_box" name="button_box">
                        <button class="oe_stat_button" type="object" icon="fa-file-text-o"
                                name="action_view_application" invisible="not application_id">
                            <field name="application_id" widget="statinfo" string="Application"/>
                        </button>
                    </div>
                    <div class="oe_title">
                        <h1>
                            <field name="name" readonly="1"/>
                        </h1>
                        <h2>
                            <field name="team_name"/>
                        </h2>
                    </div>
                    <group>
                        <group string="Identifiers">
                            <field name="uuid"/>
                            <field name="logto_org_id"/>
                            <field name="workflow_id"/>
                        </group>
                        <group string="Status">
                            <field name="is_active"/>
                            <field name="joined_date"/>
                        </group>
                    </group>
                    <group>
                        <group string="Company Details">
                            <field name="tax_id"/>
                            <field name="registration_number"/>
                            <field name="country_id"/>
                        </group>
                        <group string="Contact">
                            <field name="contact_person"/>
                            <field name="contact_email"/>
                            <field name="contact_phone"/>
                        </group>
                    </group>
                </sheet>
                <chatter/>
            </form>
        </field>
    </record>

    <record id="action_buyer_form" model="ir.actions.act_window">
        <field name="name">Buyer</field>
        <field name="res_model">buyer</field>
        <field name="view_mode">form</field>
    </record>
</odoo>
