[IMP] better UI

bzr revid: mat@openerp.com-20130411151132-vsk2cnff5uhqmzas
This commit is contained in:
Martin Trigaux 2013-04-11 17:11:32 +02:00
parent d4ccdb46de
commit 28761467fc
7 changed files with 43 additions and 26 deletions

View File

@ -140,7 +140,7 @@ class gamification_badge(osv.Model):
('everyone', 'Everyone'),
('users', 'A selected list of users'),
('having', 'People having some badges'),
('nobody', 'Nobody'),
('nobody', 'No one'),
],
string="User Authorization Rule",
help="Who can grant this badge",
@ -153,18 +153,19 @@ class gamification_badge(osv.Model):
string='Required Badges',
help="Only the people having these badges can give this badge"),
'rule_max': fields.boolean('Limited Sending',
'rule_max': fields.boolean('Monthly Limited Sending',
help="Check to set a monthly limit per person of sending this badge"),
'rule_max_number': fields.integer('Limitation Number',
help="The maximum number of time this badge can be sent per month per person."),
'stat_my_monthly_sending': fields.function(_get_month_my_sent,
type="integer",
string='My Monthly Sending Total',
help="The number of time the current user has sent this badge this month."),
'rule_automatic': fields.selection([
('manual', 'Given by Users Only'),
('goals', 'List of Goals'),
('python', 'Python Code'),
('goals', 'List of goals to reach'),
('python', 'Custom python code executed'),
('manual', 'Not automatic'),
],
string="Automatic Rule",
help="Can this badge be automatically rewarded",
@ -184,16 +185,21 @@ class gamification_badge(osv.Model):
type="many2many", relation="res.users"),
'stat_count': fields.function(_get_global_count, string='Total',
type="integer",
help="The number of time this badge has been received."),
'stat_count_distinct': fields.function(_get_unique_global_count,
string='Unique Count',
type="integer",
string='Number of users',
help="The number of time this badge has been received by individual users."),
'stat_this_month': fields.function(_get_month_count,
string='Monthly Count',
type="integer",
string='Monthly total',
help="The number of time this badge has been received this month."),
'stat_my': fields.function(_get_global_my_count, string='My Total',
type="integer",
help="The number of time the current user has received this badge."),
'stat_my_this_month': fields.function(_get_month_my_count,
type="integer",
string='My Monthly Total',
help="The number of time the current user has received this badge this month."),
}

View File

@ -85,27 +85,33 @@
</h1>
</div>
<group>
<field name="description" />
<field name="description" nolabel="1" placeholder="Badge Description" />
</group>
<group string="User Rules">
<field name="rule_auth" string="Allowed to Grant" />
<field name="rule_auth" string="Allowed to Grant" 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="stat_my_monthly_sending" attrs="{'invisible': [('rule_auth','=','nobody')]}"/>
</group>
<group string="Automatic Rules">
<field name="rule_automatic"/>
<field name="rule_automatic" widget="radio"/>
<field name="compute_code" attrs="{'invisible': [('rule_automatic','!=','python')]}"/>
<field name="goal_type_ids" attrs="{'invisible': [('rule_automatic','!=','goals')]}" widget="many2many_tags"/>
</group>
<group string="Stats">
<field name="stat_count"/>
<field name="stat_count_distinct"/>
<field name="stat_this_month"/>
<field name="stat_my"/>
<field name="stat_my_this_month"/>
<field name="stat_my_monthly_sending"/>
<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>

View File

@ -54,7 +54,7 @@
<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')]}"/>
<field name="plan_id" attrs="{'readonly':[('state','!=','draft')]}"/>
</group>
<group string="Schedule">
<field name="start_date" attrs="{'readonly':[('state','!=','draft')]}"/>
@ -69,13 +69,16 @@
<field name="last_update" groups="base.group_no_one"/>
</group>
<group string="Data" colspan="4">
<field name="target_goal" attrs="{'readonly':[('state','!=','draft')]}"/>
<field name="target_goal" attrs="{'readonly':[('state','!=','draft')]}" class="oe_inline"/>
<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>
<field name="type_condition"/>
<field name="type_suffix"/>
<field name="type_ponctual"/>
</group>
</group>
</sheet>
@ -166,9 +169,9 @@
</t>
<t t-if="record.type_condition.raw_value != 'higher'">
<div class="oe_goal_state">
<t t-esc="record.current.raw_value" /><t t-esc="record.target_goal.raw_value" />
<t t-esc="record.current.raw_value" />
</div>
<em>reached when lower than</em>
<em>reached when lower than <t t-esc="record.target_goal.raw_value" /></em>
</t>
</t>

View File

@ -1,7 +1,7 @@
/* Kanban views */
.openerp .oe_kanban_view .oe_kanban_card.oe_kanban_goal,
.openerp .oe_kanban_view .oe_kanban_card.oe_kanban_badge {
width: 200px;
width: 220px;
min-height: 200px;
}
.oe_kanban_badge_avatars {

View File

@ -123,7 +123,6 @@ openerp.gamification = function(instance) {
if (self.view.dataset.model === 'gamification.goal' && self.$el.find('.oe_goal_gauge').length == 1) {
var unique_id = _.uniqueId("goal_gauge_");
self.$el.find('.oe_goal_gauge').attr('id', unique_id);
console.log(self.record);
var g = new JustGage({
id: unique_id,
node: self.$el.find('.oe_goal_gauge').empty().get(0),

View File

@ -423,13 +423,16 @@
</record>
<record model="ir.actions.act_window" id="gamification.goal_plan_list_action">
<record id="goal_plan_list_action2" model="ir.actions.act_window">
<field name="name">Goal Plans</field>
<field name="domain">[('category', '=', 'hr')]</field>
<field name="res_model">gamification.goal.plan</field>
<field name="view_mode">kanban,form</field>
</record>
<menuitem name="Interview Requests" parent="menu_eval_hr" id="menu_open_hr_evaluation_interview_requests"
action="action_hr_evaluation_interview_tree"/>
<menuitem id="gamification_plan_menu_hr" parent="menu_eval_hr" action="gamification.goal_plan_list_action" groups="gamification.group_goal_manager"/>
<menuitem id="gamification_plan_menu_hr" parent="menu_eval_hr" action="goal_plan_list_action2" groups="gamification.group_goal_manager"/>
<menuitem id="gamification_goal_menu_hr" parent="menu_eval_hr" action="goals_menu_groupby_act" groups="gamification.group_goal_manager"/>
<!-- Email Compose message Action-->

View File

@ -34,7 +34,7 @@
What are you thank for?
<group>
<field name="employee_id" invisible="1" />
<field name="badge_id" nolabel="1" />
<field name="badge_id" nolabel="1" colspan="4" />
<field name="comment" nolabel="1" placeholder="Describe what they did and why it matters" />
</group>
<footer>