<?xml version="1.0" encoding="utf-8"?>
<odoo>

    <record id="view_sale_order_form_ot_relsum" model="ir.ui.view">
        <field name="name">sale.order.form.ot.relsum</field>
        <field name="model">sale.order</field>
        <field name="inherit_id" ref="sale.view_order_form"/>
        <field name="arch" type="xml">

            <!-- BOTONES OT EN CABECERA -->
            <xpath expr="//header" position="inside">
                <button
                    name="action_create_ot"
                    type="object"
                    string="Crear OT"
                    class="btn-primary"
                    invisible="repair_order_id"/>
                <button
                    name="action_create_ot"
                    type="object"
                    string="Ver OT"
                    class="btn-secondary"
                    invisible="not repair_order_id"/>
            </xpath>

            <!-- NOMBRE EDITABLE: quitamos el readonly que pone la vista nativa -->
            <xpath expr="//div[hasclass='oe_title']/h1/field[@name='name']" position="attributes">
                <attribute name="readonly">0</attribute>
                <attribute name="placeholder">PRE-X-2026</attribute>
            </xpath>

        </field>
    </record>

</odoo>
