<commit_before><?xml version="1.0" encoding="UTF-8"?>
<openerp>
    <data>

        <!-- Goal views -->
        <record id="goal_list_action" model="ir.actions.act_window">
            <field name="name">Goals</field>
            <field name="res_model">gamification.goal</field>
            <field name="view_mode">tree,form,calendar,kanban</field>
            <field name="help" type="html">
                <p class="oe_view_nocontent_create">
                    Click to create a goal. 
                </p>
                <p>
                    A goal is defined by a user and a goal type.
                    Goals can be created automatically by using goal plans.
                </p>
            </field>
        </record>

        <record id="goal_list_view" model="ir.ui.view">
            <field name="name">Goal List</field>
            <field name="model">gamification.goal</field>
            <field name="arch" type="xml">
                <tree string="Goal List" colors="red:state == 'failed';green:state == 'reached';grey:state == 'canceled'"> 
                    <field name="type_id"/>
                    <field name="user_id"/>
                    <field name="current"/>
                    <field name="target_goal"/>
                    <field name="start_date"/>
                    <field name="end_date"/>
                    <field name="completeness" widget="progressbar"/>
                    <field name="state" invisible="1"/>
                    <field name="planline_id" invisible="1"/>
                </tree>
            </field>
        </record>
		
		<record id="goal_form_view" model="ir.ui.view">
            <field name="name">Goal Form</field>
            <field name="model">gamification.goal</field>
            <field name="arch" type="xml">
                <form string="Goal" version="7.0">
                    <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,inprogress_update" />
                        <button string="Goal Failed" type="object" name="action_fail" states="inprogress,inprogress_update"/>
                        <button string="Reset Completion" type="object" name="action_cancel" states="failed,reached"/>
                        <field name="state" widget="statusbar" statusbar_visible="inprogress" />
                    </header>
                    <sheet>
                        <group>
                            <group string="Reference">
                                <field name="type_id" on_change="on_change_type_id(type_id)" attrs="{'readonly':[('state','!=','draft')]}"/>
                                <field name="user_id" attrs="{'readonly':[('state','!=','draft')]}"/>
                                <field name="planline_id" groups="base.group_no_one"  attrs="{'readonly':[('state','!=','draft')]}"/>
                            </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">
                                <field name="target_goal" attrs="{'readonly':[('state','!=','draft')]}"/>
                                <label for="current" />
                                <div>
                                    <field name="current"  attrs="{'readonly':[('computation_mode','!=','manually')]}" class="oe_inline"/>
                                    <button string="Refresh state" type="object" name="update" states="inprogress,inprogress_update,failed,reached" class="oe_highlight oe_inline"/>
                                    <button name="write" type="object" string="The current value is up to date" help="Indicate that the current value of the manual goal is still correct and avoid reminders" attrs="{'invisible':[('computation_mode','!=', 'manually')]}"/>
                                </div>
                            </group>
                        </group>
                    </sheet>
                    <div class="oe_chatter">
                        <field name="message_follower_ids" widget="mail_followers"/><commit_msg>[IMP] visibility of goal buttons depending of state<commit_after><?xml version="1.0" encoding="UTF-8"?>
<openerp>
    <data>

        <!-- Goal views -->
        <record id="goal_list_action" model="ir.actions.act_window">
            <field name="name">Goals</field>
            <field name="res_model">gamification.goal</field>
            <field name="view_mode">tree,form,calendar,kanban</field>
            <field name="help" type="html">
                <p class="oe_view_nocontent_create">
                    Click to create a goal. 
                </p>
                <p>
                    A goal is defined by a user and a goal type.
                    Goals can be created automatically by using goal plans.
                </p>
            </field>
        </record>

        <record id="goal_list_view" model="ir.ui.view">
            <field name="name">Goal List</field>
            <field name="model">gamification.goal</field>
            <field name="arch" type="xml">
                <tree string="Goal List" colors="red:state == 'failed';green:state == 'reached';grey:state == 'canceled'"> 
                    <field name="type_id"/>
                    <field name="user_id"/>
                    <field name="current"/>
                    <field name="target_goal"/>
                    <field name="start_date"/>
                    <field name="end_date"/>
                    <field name="completeness" widget="progressbar"/>
                    <field name="state" invisible="1"/>
                    <field name="planline_id" invisible="1"/>
                </tree>
            </field>
        </record>
		
		<record id="goal_form_view" model="ir.ui.view">
            <field name="name">Goal Form</field>
            <field name="model">gamification.goal</field>
            <field name="arch" type="xml">
                <form string="Goal" version="7.0">
                    <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,inprogress_update" />
                        <button string="Goal Failed" type="object" name="action_fail" states="inprogress,inprogress_update"/>
                        <button string="Reset Completion" type="object" name="action_cancel" states="failed,reached"/>
                        <field name="state" widget="statusbar" statusbar_visible="inprogress" />
                    </header>
                    <sheet>
                        <group>
                            <group string="Reference">
                                <field name="type_id" on_change="on_change_type_id(type_id)" attrs="{'readonly':[('state','!=','draft')]}"/>
                                <field name="user_id" attrs="{'readonly':[('state','!=','draft')]}"/>
                                <field name="planline_id" groups="base.group_no_one"  attrs="{'readonly':[('state','!=','draft')]}"/>
                            </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">
                                <field name="target_goal" attrs="{'readonly':[('state','!=','draft')]}"/>
                                <label for="current" />
                                <div>
                                    <field name="current"  attrs="{'readonly':[('computation_mode','!=','manually')]}" class="oe_inline"/>
                                    <button string="Refresh state" type="object" name="update" class="oe_highlight oe_inline" attrs="{'invisible':['|',('computation_mode', '=', 'manually'),('state', '=', 'draft')]}"/>
                                    <button name="write" type="object" string="The current value is up to date" help="Indicate that the current value of the manual goal is still correct and avoid reminders" attrs="{'invisible':['|',('computation_mode','!=', 'manually'),('state','=','draft')]}"/>
                                </div>
                            </group>
                        </group>
                    </sheet>
                    <div class="oe_chatter">
                        <field name="message_follower_ids" widget="mail_followers"/>
{'fraction_non_alphanumeric': 0.15170707570509648, 'fraction_numerical': 0.001781296387926769, 'mean_word_length': 1.5417505030181087, 'pattern_counts': {'":': 0, '<': 165, '<?xml version=': 2, '>': 165, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5303587', 'n_tokens_mistral': 2613, 'n_tokens_neox': 2464, 'n_words': 482}