<?xml version="1.0"?>
<form string="Goal" create="false">
                <header>
                    <button string="Start goal" type="object" name="action_start" states="draft" class="oe_highlight"/>

                    <button string="Goal Reached" type="object" name="action_reach" states="inprogress"/>
                    <button string="Goal Failed" type="object" name="action_fail" states="inprogress"/>
                    <button string="Reset Completion" type="object" name="action_cancel" states="failed,reached" groups="base.group_no_one"/>
                    <field name="state" widget="statusbar" statusbar_visible="draft,inprogress,reached"/>
                </header>
                <sheet>
                    <group>
                        <group string="Reference">
                            <field name="definition_id" attrs="{'readonly':[('state','!=','draft')]}"/>
                            <field name="user_id" attrs="{'readonly':[('state','!=','draft')]}"/>
                            <field name="challenge_id"/>
                        </group>
                        <group string="Schedule">
                            <field name="start_date" attrs="{'readonly':[('state','!=','draft')]}"/>
                            <field name="end_date"/>
                            <field name="computation_mode" invisible="1"/>

                            <label for="remind_update_delay" attrs="{'invisible':[('computation_mode','!=', 'manually')]}"/>
                            <div attrs="{'invisible':[('computation_mode','!=', 'manually')]}">
                                <field name="remind_update_delay" class="oe_inline"/>
                                days
                            </div>
                            <field name="last_update" groups="base.group_no_one"/>
                        </group>
                        <group string="Data" colspan="4">
                            <label for="target_goal"/>
                            <div>
                                <field name="target_goal" attrs="{'readonly':[('state','!=','draft')]}" class="oe_inline"/>
                                <field name="definition_suffix" class="oe_inline"/>
                            </div>
                            <label for="current"/>
                            <div>
                                <field name="current" class="oe_inline"/>
                                <button string="refresh" type="object" name="update_goal" class="oe_link" attrs="{'invisible':['|',('computation_mode', '=', 'manually'),('state', '=', 'draft')]}"/>
                                <div class="oe_grey" attrs="{'invisible':[('definition_id', '=', False)]}">
                                    Reached when current value is <strong><field name="definition_condition" class="oe_inline"/></strong> than the target.
                                </div>
                            </div>
                        </group>
                    </group>
                </sheet>
            </form>
        