<form model="clinic.schedule" attrs='{"readonly":[["state","in",["confirmed"]]]}' show_company="1">
    <head>
        <field name="state"/>
        <button string="Options" dropdown="1">
            <item string="Copy" action="clinic_schedule_copy"/>
            <item string="Get Nurse" action="clinic_load_nurses" states="draft"/>
            <item string="Reset Nurse" method="clear" confirm="Are you sure to remove all item?" states="draft"/>
            <item string="To Draft" method="to_draft" states="confirmed"/>
        </button>
    </head>
    <tabs>
        <tab string="General">
            <group form_layout="stacked">
                <field name="date" span="3" onchange="onchange_date"/>
                <field name="branch_id" span="3" onchange="onchange_branch"/>
                <field name="department_id" domain='[["branch_id","=",branch_id]]' span="3"/>
                <field name="lines" nolabel="1">
                    <list>
                        <field name="cycle_id"/>
                        <field name="nurse_id" onchange="onchange_nurse" domain='[["department_id","=",parent.department_id]]'/>
                        <field name="level_id"/>
                        <field name="state"/>
                        <field name="cycle_item_id" readonly="1"/>
                        <field name="note"/>
                    </list>
                </field>
                <field name="company_id" invisible="1"/>
            </group>
        </tab>
        <tab string="Planning">
            <group form_layout="stacked">
                <field name="time_start" span="3"/>
                <field name="time_stop" span="3"/>
            </group>
        </tab>
        <tab string="Confirmation">
            <field name="user_id"/>
        </tab>
    </tabs>
    <foot>
        <button string="Confirm" type="success" icon="ok" method="confirm" states="draft" />
    </foot>
</form>