<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <record id="kyc_application_view_form" model="ir.ui.view">
        <field name="name">kyc.application.form</field>
        <field name="model">kyc.application</field>
        <field name="arch" type="xml">
            <form string="KYC Application">
                <header>
                    <field name="state" widget="statusbar" statusbar_visible="pending,in_review,approved,rejected"/>
                    <button name="action_start_review" type="object" string="Start Review"
                            class="btn-primary" invisible="state != 'pending'"/>
                    <button name="action_approve" type="object" string="Approve &amp; Create Buyer"
                            class="btn-success" invisible="state not in ('pending', 'in_review')"/>
                    <button name="action_reject" type="object" string="Reject"
                            class="btn-danger" invisible="state not in ('pending', 'in_review')"/>
                </header>
                <sheet>
                    <div class="oe_button_box" name="button_box">
                        <button name="action_view_buyer" type="object"
                                class="oe_stat_button" icon="fa-building"
                                invisible="not buyer_id">
                            <field name="buyer_id" widget="statinfo" string="Buyer"/>
                        </button>
                    </div>
                    <div class="oe_title">
                        <h1>
                            <field name="name" readonly="1"/>
                        </h1>
                    </div>
                    <group>
                        <group string="Team Information">
                            <field name="team_name"/>
                            <field name="owner_id"/>
                            <field name="workflow_id"/>
                        </group>
                        <group string="KYC Assessment">
                            <field name="score"/>
                            <field name="reviewer_id"/>
                            <field name="reviewed_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>
                    <group>
                        <group string="Dates">
                            <field name="submitted_date"/>
                            <field name="approved_date"/>
                        </group>
                    </group>
                    <notebook>
                        <page string="Review Notes" name="review_notes">
                            <field name="review_notes"/>
                        </page>
                    </notebook>
                </sheet>
                <chatter/>
            </form>
        </field>
    </record>
</odoo>
