<?xml version="1.0" encoding="UTF-8"?>
<odoo>
    <!-- Tree View -->
    <record id="fusion_pdf_preview_log_tree" model="ir.ui.view">
        <field name="name">fusion.pdf.preview.log.tree</field>
        <field name="model">fusion.pdf.preview.log</field>
        <field name="arch" type="xml">
            <list string="PDF Preview Audit Log" create="0" edit="0" delete="0">
                <field name="create_date" string="Date"/>
                <field name="user_id"/>
                <field name="report_name"/>
                <field name="action_type"/>
                <field name="model_name"/>
                <field name="record_ids"/>
            </list>
        </field>
    </record>

    <!-- Form View -->
    <record id="fusion_pdf_preview_log_form" model="ir.ui.view">
        <field name="name">fusion.pdf.preview.log.form</field>
        <field name="model">fusion.pdf.preview.log</field>
        <field name="arch" type="xml">
            <form string="PDF Preview Log Entry" create="0" edit="0" delete="0">
                <sheet>
                    <group>
                        <group string="Details">
                            <field name="create_date"/>
                            <field name="user_id"/>
                            <field name="action_type"/>
                        </group>
                        <group string="Report">
                            <field name="report_id"/>
                            <field name="report_name"/>
                            <field name="model_name"/>
                            <field name="record_ids"/>
                        </group>
                    </group>
                </sheet>
            </form>
        </field>
    </record>

    <!-- Action -->
    <record id="action_fusion_pdf_preview_log" model="ir.actions.act_window">
        <field name="name">PDF Preview Audit Log</field>
        <field name="res_model">fusion.pdf.preview.log</field>
        <field name="view_mode">list,form</field>
        <field name="help" type="html">
            <p class="o_view_nocontent_smiling_face">
                No PDF preview activity has been logged yet.
            </p>
            <p>
                This log tracks when users preview, print, or download PDF reports.
            </p>
        </field>
    </record>

    <!-- Menu Item under Settings -->
    <menuitem id="menu_fusion_pdf_preview_log"
              name="PDF Preview Log"
              action="action_fusion_pdf_preview_log"
              parent="base.menu_administration"
              sequence="99"
              groups="base.group_system"/>
</odoo>
