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

                    <button string="Goal Reached" type="object" name="action_reach" invisible="state != 'inprogress'"/>
                    <button string="Goal Failed" type="object" name="action_fail" invisible="state != 'inprogress'"/>
                    <button string="Reset Completion" type="object" name="action_cancel" invisible="state not in ('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" readonly="state != 'draft'"/>
                            <field name="user_id" readonly="state != 'draft'"/>
                            <field name="challenge_id"/>
                        </group>
                        <group string="Schedule">
                            <field name="start_date" readonly="state != 'draft'"/>
                            <field name="end_date"/>
                            <field name="computation_mode" invisible="1"/>

                            <label for="remind_update_delay" invisible="computation_mode != 'manually'"/>
                            <div 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" 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" invisible="computation_mode == 'manually' or state == 'draft'"/>
                                <div class="oe_grey" invisible="not definition_id">
                                    Reached when current value is <strong><field name="definition_condition" class="oe_inline"/></strong> than the target.
                                </div>
                            </div>
                        </group>
                    </group>
                </sheet>
            </form>
        