<commit_before><odoo>
    <!-- Badge views -->
    <record id="badge_list_action" model="ir.actions.act_window">
        <field name="name">Badges</field>
        <field name="res_model">gamification.badge</field>
        <field name="view_mode">kanban,tree,form</field>
        <field name="help" type="html">
            <p class="oe_view_nocontent_create">
                Click to create a badge.
            </p>
            <p>
                A badge is a symbolic token granted to a user as a sign of reward.
                It can be deserved automatically when some conditions are met or manually by users.
                Some badges are harder than others to get with specific conditions.
            </p>
        </field>
    </record>

    <record id="badge_list_view" model="ir.ui.view">
        <field name="name">Badge List</field>
        <field name="model">gamification.badge</field>
        <field name="arch" type="xml">
            <tree string="Badge List">
                <field name="name"/>
                <field name="stat_count"/>
                <field name="stat_this_month"/>
                <field name="stat_my"/>
                <field name="rule_auth"/>
            </tree>
        </field>
    </record>

    <record id="badge_form_view" model="ir.ui.view">
        <field name="name">Badge Form</field>
        <field name="model">gamification.badge</field>
        <field name="arch" type="xml">
            <form string="Badge">
                <header>
                    <button string="Grant this Badge" type="action" name="%(action_grant_wizard)d" class="oe_highlight" attrs="{'invisible': [('remaining_sending','=',0)]}" />
                </header>
                <sheet>
                    <div class="oe_button_box" name="button_box"/>
                    <field name="image" widget='image' class="oe_avatar"/>
                    <div class="oe_title">
                        <label for="name" class="oe_edit_only"/>
                        <h1>
                            <field name="name" placeholder="Badge Name"/>
                        </h1>
                    </div>
                    <group>
                        <field name="description" nolabel="1" placeholder="Badge Description"/>
                    </group>
                    <group string="Granting">
                        <div class="oe_grey" colspan="2">
                            Security rules to define who is allowed to manually grant badges. Not enforced for administrator.
                        </div>
                        <group>
                            <field name="rule_auth" widget="radio"/>
                            <field name="rule_auth_user_ids" attrs="{'invisible': [('rule_auth','!=','users')]}" widget="many2many_tags" />
                            <field name="rule_auth_badge_ids" attrs="{'invisible': [('rule_auth','!=','having')]}" widget="many2many_tags" />
                            <field name="rule_max" attrs="{'invisible': [('rule_auth','=','nobody')]}" />
                            <field name="rule_max_number" attrs="{'invisible': ['|',('rule_max','=',False),('rule_auth','=','nobody')]}"/>
                            <label for="stat_my_monthly_sending"/>
                            <div>
                                <field name="stat_my_monthly_sending" attrs="{'invisible': [('rule_auth','=','nobody')]}" />
                                <div attrs="{'invisible': [('remaining_sending','=',-1)]}" class="oe_grey">
                                    You can still grant <field name="remaining_sending" class="oe_inline"/> badges this month
                                </div>
                                <div attrs="{'invisible': [('remaining_sending','!=',-1)]}" class="oe_grey">
                                    No monthly sending limit
                                </div>
                            </div>
                        </group>
                    </group>
                    <group string="Rewards for challenges">
                        <field name="challenge_ids" nolabel="1" context="{'default_reward_id': active_id}" />
                    </group>
                    <group string="Statistics">
                        <group>
                            <field name="stat_count"/>
                            <field name="stat_this_month"/>
                            <field name="stat_count_distinct"/>
                        </group>
                        <group>
                            <field name="stat_my"/>
                            <field name="stat_my_this_month"/>
                        </group>
                    </group>
                </sheet>
            </form>
        </field>
    </record>


    <record id="badge_kanban_view" model="ir.ui.view" >
        <field name="name">Badge Kanban View</field>
        <field name="model">gamification.badge</field>
        <field name="arch" type="xml">
            <kanban class="o_kanban_badge">
                <field name="name"/>
                <field name="description"/>
                <field name="image"/>
                <field name="stat_my"/>
                <field name="stat_count"/>
                <field name="stat_this_month"/>
                <field name="unique_owner_ids"/>
                <field name="stat_my_monthly_sending"/>
                <field name="remaining_sending" />
                <field name="rule_max_number" />
                <templates>
                    <t t-name="kanban-box">
                        <div t-attf-class="o_kanban_gamification oe_kanban_global_click #{record.stat_my.raw_value ? 'oe_kanban_color_5' : 'oe_kanban_color_white'}">
                            <div class="o_kanban_image">
                                <img t-att-src="kanban_image('gamification.badge', 'image', record.image.raw_value)" t-att-title="record.name.value"/>
                            </div>
                            <div class="oe_kanban_details">
                                <strong><field name="name"/></strong>
                                <span class="oe_grey">
                                    <t t-if="record.remaining_sending.value != -1">
                                        <t t-esc="record.stat_my_monthly_sending.value"/>/<t t-esc="record.rule_max_number.value"/>
                                    </t><commit_msg>[FIX] gamification: put the correct id in `kanban_image`<commit_after><odoo>
    <!-- Badge views -->
    <record id="badge_list_action" model="ir.actions.act_window">
        <field name="name">Badges</field>
        <field name="res_model">gamification.badge</field>
        <field name="view_mode">kanban,tree,form</field>
        <field name="help" type="html">
            <p class="oe_view_nocontent_create">
                Click to create a badge.
            </p>
            <p>
                A badge is a symbolic token granted to a user as a sign of reward.
                It can be deserved automatically when some conditions are met or manually by users.
                Some badges are harder than others to get with specific conditions.
            </p>
        </field>
    </record>

    <record id="badge_list_view" model="ir.ui.view">
        <field name="name">Badge List</field>
        <field name="model">gamification.badge</field>
        <field name="arch" type="xml">
            <tree string="Badge List">
                <field name="name"/>
                <field name="stat_count"/>
                <field name="stat_this_month"/>
                <field name="stat_my"/>
                <field name="rule_auth"/>
            </tree>
        </field>
    </record>

    <record id="badge_form_view" model="ir.ui.view">
        <field name="name">Badge Form</field>
        <field name="model">gamification.badge</field>
        <field name="arch" type="xml">
            <form string="Badge">
                <header>
                    <button string="Grant this Badge" type="action" name="%(action_grant_wizard)d" class="oe_highlight" attrs="{'invisible': [('remaining_sending','=',0)]}" />
                </header>
                <sheet>
                    <div class="oe_button_box" name="button_box"/>
                    <field name="image" widget='image' class="oe_avatar"/>
                    <div class="oe_title">
                        <label for="name" class="oe_edit_only"/>
                        <h1>
                            <field name="name" placeholder="Badge Name"/>
                        </h1>
                    </div>
                    <group>
                        <field name="description" nolabel="1" placeholder="Badge Description"/>
                    </group>
                    <group string="Granting">
                        <div class="oe_grey" colspan="2">
                            Security rules to define who is allowed to manually grant badges. Not enforced for administrator.
                        </div>
                        <group>
                            <field name="rule_auth" widget="radio"/>
                            <field name="rule_auth_user_ids" attrs="{'invisible': [('rule_auth','!=','users')]}" widget="many2many_tags" />
                            <field name="rule_auth_badge_ids" attrs="{'invisible': [('rule_auth','!=','having')]}" widget="many2many_tags" />
                            <field name="rule_max" attrs="{'invisible': [('rule_auth','=','nobody')]}" />
                            <field name="rule_max_number" attrs="{'invisible': ['|',('rule_max','=',False),('rule_auth','=','nobody')]}"/>
                            <label for="stat_my_monthly_sending"/>
                            <div>
                                <field name="stat_my_monthly_sending" attrs="{'invisible': [('rule_auth','=','nobody')]}" />
                                <div attrs="{'invisible': [('remaining_sending','=',-1)]}" class="oe_grey">
                                    You can still grant <field name="remaining_sending" class="oe_inline"/> badges this month
                                </div>
                                <div attrs="{'invisible': [('remaining_sending','!=',-1)]}" class="oe_grey">
                                    No monthly sending limit
                                </div>
                            </div>
                        </group>
                    </group>
                    <group string="Rewards for challenges">
                        <field name="challenge_ids" nolabel="1" context="{'default_reward_id': active_id}" />
                    </group>
                    <group string="Statistics">
                        <group>
                            <field name="stat_count"/>
                            <field name="stat_this_month"/>
                            <field name="stat_count_distinct"/>
                        </group>
                        <group>
                            <field name="stat_my"/>
                            <field name="stat_my_this_month"/>
                        </group>
                    </group>
                </sheet>
            </form>
        </field>
    </record>


    <record id="badge_kanban_view" model="ir.ui.view" >
        <field name="name">Badge Kanban View</field>
        <field name="model">gamification.badge</field>
        <field name="arch" type="xml">
            <kanban class="o_kanban_badge">
                <field name="id"/>
                <field name="name"/>
                <field name="description"/>
                <field name="image"/>
                <field name="stat_my"/>
                <field name="stat_count"/>
                <field name="stat_this_month"/>
                <field name="unique_owner_ids"/>
                <field name="stat_my_monthly_sending"/>
                <field name="remaining_sending" />
                <field name="rule_max_number" />
                <templates>
                    <t t-name="kanban-box">
                        <div t-attf-class="o_kanban_gamification oe_kanban_global_click #{record.stat_my.raw_value ? 'oe_kanban_color_5' : 'oe_kanban_color_white'}">
                            <div class="o_kanban_image">
                                <img t-att-src="kanban_image('gamification.badge', 'image', record.id.raw_value)" t-att-title="record.name.value"/>
                            </div>
                            <div class="oe_kanban_details">
                                <strong><field name="name"/></strong>
                                <span class="oe_grey">
                                    <t t-if="record.remaining_sending.value != -1">
                                        <t t-esc="record.stat_my_monthly_sending.value"/>/<t t-esc="record.rule_max_number.value"/>
                                    </t>
{'fraction_non_alphanumeric': 0.13785864240727783, 'fraction_numerical': 0.0018661068346162819, 'mean_word_length': 1.3947123440700055, 'pattern_counts': {'":': 0, '<': 250, '<?xml version=': 0, '>': 250, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3204667', 'n_tokens_mistral': 3453, 'n_tokens_neox': 3294, 'n_words': 642}