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

    <record id="cx_tower_plan_line_view_action_form" model="ir.ui.view">
        <field name="name">cx.tower.plan.line.view.action.form</field>
        <field name="model">cx.tower.plan.line.action</field>
        <field name="arch" type="xml">
            <form>
                <sheet>
                    <group>
                        <field name="sequence" />
                        <label for="condition" string="If exit code" />
                        <div class="o_row">
                            <field name="condition" />
                            <field name="value_char" />
                        </div>
                        <label for="action" string="Then" />
                        <div class="o_row">
                            <field name="action" />
                            <field
                                name="custom_exit_code"
                                attrs="{'invisible': [('action', '!=', 'ec')], 'required': [('action', '=', 'ec')]}"
                            />
                        </div>
                    </group>
                    <p><b>AND</b></p>
                    <group>
                        <field
                            name="variable_value_ids"
                            order="variable_reference"
                            string="Set Custom Values"
                            help="Custom values will be available in the current flight plan context only. They can be used in Python commands and line conditions"
                        >
                            <tree editable="bottom">
                                <field name="sequence" widget="handle" />
                                <field name="reference" optional="hide" />
                                <field name="variable_reference" optional="hide" />
                                <field name="variable_id" />
                                <field name="variable_type" invisible="1" />
                                <field
                                    name="value_char"
                                    attrs="{'readonly': [('variable_type', '=', 'o')]}"
                                />
                                <field
                                    name="option_id"
                                    options="{'no_create': True, 'no_create_edit': True}"
                                    attrs="{'readonly': [('variable_type', '=', 's')]}"
                                />
                                <field name="access_level" optional="show" />
                            </tree>
                            <form>
                                <group>
                                    <field name="variable_id" />
                                    <field name="value_char" />
                                    <field name="access_level" />
                                </group>
                                <field
                                    name="note"
                                    placeholder="Put your notes here..."
                                />
                            </form>
                        </field>
                    </group>

                </sheet>
            </form>
        </field>
    </record>

</odoo>
