[IMP] project: project form view cleaning, project stage form view

overhaul: usability improvements, better user experience.

By the way: fixed the column tooltips display in kanban view.
This commit is contained in:
Bhumi Patel
2015-01-19 16:39:31 +01:00
committed by Thibault Delavallée
parent fe7b6ef900
commit e8eced9f36
8 changed files with 55 additions and 24 deletions
+3 -3
View File
@@ -40,12 +40,12 @@ class project_task_type(osv.osv):
_order = 'sequence'
_columns = {
'name': fields.char('Stage Name', required=True, translate=True),
'description': fields.text('Description'),
'description': fields.text('Description', translate=True),
'sequence': fields.integer('Sequence'),
'case_default': fields.boolean('Default for New Projects',
help="If you check this field, this stage will be proposed by default on each new project. It will not assign this stage to existing projects."),
'project_ids': fields.many2many('project.project', 'project_task_type_rel', 'type_id', 'project_id', 'Projects'),
'legend_priority': fields.text(
'legend_priority': fields.char(
'Priority Management Explanation', translate=True,
help='Explanation text to help users using the star and priority mechanism on stages or issues that are in this stage.'),
'legend_blocked': fields.char(
@@ -1245,7 +1245,7 @@ class account_analytic_account(osv.osv):
_inherit = 'account.analytic.account'
_description = 'Analytic Account'
_columns = {
'use_tasks': fields.boolean('Tasks', help="If checked, this contract will be available in the project menu and you will be able to manage tasks or track issues"),
'use_tasks': fields.boolean('Tasks', help="Check this box to manage internal activities through this project"),
'company_uom_id': fields.related('company_id', 'project_time_mode_id', string="Company UOM", type='many2one', relation='product.uom'),
}
+34 -12
View File
@@ -93,15 +93,17 @@
<h1>
<field name="name" string="Project Name"/>
</h1>
<div name="options_active">
<div name="options_active" class="oe_edit_only">
<div>
<field name="use_tasks" class="oe_inline" string="Use Tasks"/>
<label for="use_tasks" class="oe_inline"/> as <field name="label_tasks" class="oe_inline"/>
<label for="use_tasks" class="oe_inline"/>
<span attrs="{'invisible':[('use_tasks', '=', False)]}">as</span>
<field name="label_tasks" class="oe_inline oe_input_align" attrs="{'invisible': [('use_tasks', '=', False)]}"/>
</div>
</div>
</div>
<div class="oe_right oe_button_box" name="buttons" groups="base.group_user">
<button class="oe_inline oe_stat_button" type="action" attrs="{'invisible':[('use_tasks','=', 0)]}"
<button class="oe_inline oe_stat_button" type="action" attrs="{'invisible':[('use_tasks','=', False)]}"
name="%(act_project_project_2_project_task_all)d" icon="fa-tasks">
<field string="Tasks" name="task_count" widget="statinfo" options="{'label_field': 'label_tasks'}"/>
</button>
@@ -501,7 +503,7 @@
<kanban default_group_by="stage_id">
<field name="color"/>
<field name="priority"/>
<field name="stage_id" options='{"group_by_tooltip": {"description": "Description", "legend_priority": "Use of stars"}}'/>
<field name="stage_id" options='{"group_by_tooltip": {"description": "Stage Description", "legend_priority": "Use of stars"}}'/>
<field name="user_id"/>
<field name="user_email"/>
<field name="description"/>
@@ -720,18 +722,37 @@
<group>
<group>
<field name="name"/>
<field name="sequence"/>
<field name="case_default"/>
<field name="fold"/>
<field name="sequence" groups="base.group_no_one"/>
</group>
<group>
<field name="legend_blocked"/>
<field name="legend_done"/>
<field name="legend_normal"/>
<field name="legend_priority"/>
<field name="fold"/>
</group>
</group>
<field name="description" placeholder="Add a description..."/>
<group string="Stage Description and Tooltips">
<p class="text-muted" colspan="2">
At each stage employees can block or make task/issue ready for next stage.
You can define here labels that will be displayed for the state instead
of the default labels.
</p>
<label for="legend_normal" string=" " class="oe_kanban_status oe_project_kanban_legend"/>
<field name="legend_normal" nolabel="1"/>
<label for="legend_blocked" string=" " class="oe_kanban_status oe_kanban_status_red oe_project_kanban_legend"/>
<field name="legend_blocked" nolabel="1"/>
<label for="legend_done" string=" " class="oe_kanban_status oe_kanban_status_green oe_project_kanban_legend"/>
<field name="legend_done" nolabel="1"/>
<p class="text-muted" colspan="2">
You can also give a tooltip about the use of the stars available in the kanban and form views.
</p>
<label for="legend_priority" string="7" class="oe_e oe_star_on oe_project_kanban_legend"/>
<field name="legend_priority" nolabel="1"/>
<p class="text-muted" colspan="2">
You can also add a description to help your coworkers understanding the meaning and purpose of the stage.
</p>
<field name="description" placeholder="Add a description..." nolabel="1" colspan="2"/>
</group>
</form>
</field>
</record>
@@ -741,9 +762,10 @@
<field name="model">project.task.type</field>
<field name="arch" type="xml">
<tree string="Task Stage">
<field name="sequence" widget="handle"/>
<field name="sequence" widget="handle" groups="base.group_no_one"/>
<field name="name"/>
<field name="fold"/>
<field name="description"/>
</tree>
</field>
</record>
@@ -41,3 +41,9 @@
.openerp .oe_margin_top_8 {
margin-top: 8px;
}
.openerp label.oe_project_kanban_legend {
min-width: inherit !important;
margin-top: 6px;
margin-right: 8px;
}
+1 -1
View File
@@ -525,7 +525,7 @@ class account_analytic_account(osv.Model):
_description = 'Analytic Account'
_columns = {
'use_issues': fields.boolean('Issues', help="Check this field if this project manages issues"),
'use_issues': fields.boolean('Issues', help="Check this box to manage customer activities through this project"),
}
def on_change_template(self, cr, uid, ids, template_id, date_start=False, context=None):
+3 -1
View File
@@ -317,7 +317,9 @@
<div>
<field name="use_issues" class="oe_inline" string="Use Issues"
on_change="on_change_use_tasks_or_issues(use_tasks, use_issues)"/>
<label for="use_issues" class="oe_inline"/> as <field name="label_issues" class="oe_inline"/>
<label for="use_issues" class="oe_inline"/>
<span attrs="{'invisible':[('use_issues', '=', False)]}">as</span>
<field name="label_issues" class="oe_inline oe_input_align" attrs="{'invisible': [('use_issues', '=', False)]}"/>
</div>
</xpath>
<xpath expr='//div[@name="buttons"]' position='inside'>
+1 -1
View File
@@ -107,7 +107,7 @@ class ProjectTaskStageMrp(osv.Model):
_inherit = 'project.task.type'
_columns = {
'closed': fields.boolean('Close', help="Tasks in this stage are considered as closed."),
'closed': fields.boolean('Is a close stage', help="Tasks in this stage are considered as closed."),
}
_defaults = {
@@ -29,7 +29,7 @@
<field name="model">project.task.type</field>
<field name="inherit_id" ref="project.task_type_edit"/>
<field name="arch" type="xml">
<field name="case_default" position="after">
<field name="fold" position="after">
<field name="closed"/>
</field>
</field>
+6 -5
View File
@@ -728,11 +728,12 @@ instance.web_kanban.KanbanGroup = instance.web.Widget.extend({
};
recurse(this.view.fields_view.arch);
if (options && options.group_by_tooltip) {
this.tooltip = _.union(
[this.title],
_.map(
options.group_by_tooltip,
function (key, value, list) { return self.values && self.values[value] || ''; })
this.tooltip = _.compact(
_.union(
[this.title],
_.map(
options.group_by_tooltip,
function (key, value, list) { return self.values && self.values[value] && (key + "\n" + self.values[value]) || ''; }))
).join('\n\n');
this.$(".oe_kanban_group_title_text").attr("title", this.tooltip || this.title || "");
}