<?xml version="1.0"?>
<form string="Badge">
                <header>
                    <button string="Grant this Badge" type="action" name="315" class="oe_highlight" attrs="{'invisible': [('remaining_sending','=',0)]}"/>
                </header>
                <sheet>
                    <div class="oe_button_box" name="button_box"/>
                    <widget name="web_ribbon" title="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/>
                    <field name="image_1920" widget="image" class="oe_avatar" options="{'preview_image': 'image_128'}"/>
                    <div class="oe_title">
                        <label for="name"/>
                        <h1>
                            <field name="name" placeholder="e.g. Problem Solver"/>
                        </h1>
                    </div>
                    <group>
                        <field name="description" nolabel="1" placeholder="Badge Description" colspan="2"/>
                    </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="active" invisible="1"/>
                            <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" mode="kanban" widget="many2many" nolabel="1" context="{'default_reward_id': active_id}" colspan="2"/>
                        <field name="level" colspan="2"/>
                    </group>
                    <group id="badge_statistics" string="Statistics">
                        <group>
                            <field name="granted_count"/>
                            <field name="stat_this_month"/>
                            <field name="granted_users_count"/>
                        </group>
                        <group>
                            <field name="stat_my"/>
                            <field name="stat_my_this_month"/>
                        </group>
                    </group>
                </sheet>
            </form>
        