19.0 vanilla

This commit is contained in:
Ernad Husremovic 2026-03-09 09:32:43 +01:00
parent 4607ccbd2e
commit 825ff6514e
487 changed files with 184979 additions and 195262 deletions

View file

@ -16,7 +16,8 @@
<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="path">badges</field>
<field name="view_mode">kanban,list,form</field>
<field name="search_view_id" ref="gamification_badge_view_search"/>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
@ -34,13 +35,13 @@
<field name="name">Badge List</field>
<field name="model">gamification.badge</field>
<field name="arch" type="xml">
<tree string="Badge List">
<list string="Badge List">
<field name="name"/>
<field name="granted_count"/>
<field name="stat_this_month"/>
<field name="stat_my"/>
<field name="rule_auth"/>
</tree>
</list>
</field>
</record>
@ -50,11 +51,11 @@
<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)]}" />
<button string="Grant this Badge" type="action" name="%(action_grant_wizard)d" class="oe_highlight" 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)]}"/>
<widget name="web_ribbon" title="Archived" bg_color="bg-danger" invisible="active"/>
<field name="image_1920" widget="image" class="oe_avatar" options="{'preview_image': 'image_128'}"/>
<div class="oe_title">
<label for="name"/>
@ -66,30 +67,30 @@
<field name="description" nolabel="1" placeholder="Badge Description" colspan="2"/>
</group>
<group string="Granting">
<div class="oe_grey" colspan="2">
<div class="opacity-50" 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')]}"/>
<field name="rule_auth_user_ids" invisible="rule_auth != 'users'" widget="many2many_tags" />
<field name="rule_auth_badge_ids" invisible="rule_auth != 'having'" widget="many2many_tags" />
<field name="rule_max" invisible="rule_auth == 'nobody'" />
<field name="rule_max_number" invisible="not rule_max or 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">
<field name="stat_my_monthly_sending" invisible="rule_auth == 'nobody'" />
<div invisible="remaining_sending == -1" class="opacity-50">
You can still grant <field name="remaining_sending" class="oe_inline"/> badges this month
</div>
<div attrs="{'invisible': [('remaining_sending','!=',-1)]}" class="oe_grey">
<div invisible="remaining_sending != -1" class="opacity-50">
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="challenge_ids" mode="kanban" widget="many2many" nolabel="1" context="{'default_reward_id': id}" colspan="2"/>
<field name="level" colspan="2"/>
</group>
<group id="badge_statistics" string="Statistics">
@ -113,51 +114,36 @@
<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="stat_my"/>
<field name="granted_count"/>
<field name="stat_this_month"/>
<field name="unique_owner_ids"/>
<field name="stat_my_monthly_sending"/>
<kanban>
<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_1024', record.id.raw_value)" t-att-title="record.name.value" t-att-alt="record.name.value"/>
<t t-name="card" class="row g-0">
<aside class="col-2">
<field name="image_1024" widget="image" t-att-alt="record.name.value"/>
</aside>
<main class="col ps-2">
<span>
<field class="fw-bold fs-5 me-1" name="name"/>
<t t-if="record.remaining_sending.value != -1">
<field name="stat_my_monthly_sending"/>/<field name="rule_max_number"/>
</t>
<t t-else="">
<field name="stat_my_monthly_sending"/>/∞
</t>
</span>
<div t-if="record.remaining_sending.value == 0">Can not grant</div>
<div>
<field class="fw-bold" name="granted_count"/> granted,
<field class="fw-bold" name="stat_this_month"/> this month
</div>
<div class="oe_kanban_details">
<strong class="o_kanban_record_title"><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>
<t t-if="record.remaining_sending.value == -1">
<t t-esc="record.stat_my_monthly_sending.value"/>/∞
</t>
</span>
<div t-if="record.remaining_sending.value == 0" class="oe_grey">Can not grant</div>
<div>
<strong><t t-esc="record.granted_count.raw_value"/></strong> granted,
<strong><t t-esc="record.stat_this_month.raw_value"/></strong> this month
</div>
<div t-if="!widget.isHtmlEmpty(record.description.value)" class="o_kanban_badge_description pb-3">
<em t-out="record.description.value"/>
<div>
<t t-foreach="record.unique_owner_ids.raw_value.slice(0,11)" t-as="owner" t-key="owner">
<img class="oe_kanban_avatar o_image_24_cover rounded-circle" t-att-src="kanban_image('res.users', 'avatar_128', owner)" t-att-data-member_id="owner" alt="Owner"/>
</t>
</div>
</div>
<div t-if="record.remaining_sending.value != 0 and !selection_mode" class="o_kanban_button">
<button type="action" name="%(action_grant_wizard)d" class="oe_highlight btn btn-primary">Grant</button>
</div>
<div>
<field class="fst-italic" name="description"/>
<field name="unique_owner_ids" widget="many2many_avatar_user"/>
</div>
</div>
<footer t-if="record.remaining_sending.value != 0 and !selection_mode">
<button type="action" name="%(action_grant_wizard)d" class="btn btn-primary ms-auto">Grant</button>
</footer>
</main>
</t>
</templates>
</kanban>