[IMP] project: kanban customization
[odoo/odoo.git] / addons / project / project_view.xml
index 5cff324..59c532c 100644 (file)
                         <h1>
                             <field name="name" string="Project Name"/>
                         </h1>
-                        <div name="options_active" invisible="1">
-                            <field name="use_tasks" class="oe_inline"/>
-                            <label for="use_tasks" name="use_task" string="Use Tasks"/>
+                        <div name="options_active">
+                            <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"/>
+                            </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)]}"
                             name="%(act_project_project_2_project_task_all)d" icon="fa-tasks">
-                            <field string="Tasks" name="task_count" widget="statinfo"/>
+                            <field string="Tasks" name="task_count" widget="statinfo" options="{'label_field': 'label_tasks'}"/>
                         </button>
                         <button  class="oe_inline oe_stat_button" name="attachment_tree_view"  type="object" icon="fa-files-o">
                             <field string="Documents" name="doc_count" widget="statinfo"/>
                                     </div>
                                     <div class="row oe_margin_top_8 oe_kanban_project_list">
                                         <a t-if="record.use_tasks.raw_value" class="oe_sparkline_bar_link" name="%(act_project_project_2_project_task_all)d" type="action" style="margin-right: -5px">
-                                            <t t-raw="record.task_ids.raw_value.length" /> Tasks
+                                            <t t-raw="record.task_ids.raw_value.length" /> <field name="label_tasks"/>
                                             <field name="monthly_tasks" widget="sparkline_bar" options="{'delayIn': '1000'}">
                                                 Created Tasks
                                             </field>
                             <field name="name" placeholder="Task summary..." class="oe_inline"/>
                         </h1>
                         <div class="col-xs-1 text-right">
-                            <field name="kanban_state" class="oe_inline" widget="kanban_state_selection"/>
+                            <field name="kanban_state" class="oe_inline" widget="kanban_state_selection"
+                                options='{
+                                "states_legend_field": "stage_id",
+                                "states_legend": {"normal": "legend_normal", "blocked": "legend_blocked", "done": "legend_done"}}'/>
                         </div>
                     </div>
                     <group>
             <field name="name">project.task.kanban</field>
             <field name="model">project.task</field>
             <field name="arch" type="xml">
-                <kanban default_group_by="stage_id" >
+                <kanban default_group_by="stage_id">
                     <field name="color"/>
                     <field name="priority"/>
-                    <field name="stage_id"/>
+                    <field name="stage_id" options='{"group_by_tooltip": {"description": "Description", "legend_priority": "Use of stars"}}'/>
                     <field name="user_id"/>
                     <field name="user_email"/>
                     <field name="description"/>
                     <field name="sequence"/>
-                    <field name="kanban_state"/>
                     <field name="remaining_hours" sum="Remaining Time" groups="project.group_time_work_estimation_tasks"/>
                     <field name="date_deadline"/>
                     <field name="message_summary"/>
                                     <div class="oe_kanban_bottom_right">
                                         <img t-att-src="kanban_image('res.users', 'image_small', record.user_id.raw_value)" t-att-title="record.user_id.value" width="24" height="24" class="oe_kanban_avatar pull-right"/>
                                         <div class="pull-left" groups="base.group_user">
-                                            <field name="kanban_state" widget="kanban_state_selection"/>
+                                            <field name="kanban_state" widget="kanban_state_selection" 
+                                                options='{"states_legend": {"normal": "legend_normal", "blocked": "legend_blocked", "done": "legend_done"}}'/>
                                             <field name="priority" widget="priority"/>
                                         </div>
                                     </div>
                         <group>
                             <field name="name"/>
                             <field name="sequence"/>
-                        </group>
-                        <group>
                             <field name="case_default"/>
                             <field name="fold"/>
                         </group>
+                        <group>
+                            <field name="legend_blocked"/>
+                            <field name="legend_done"/>
+                            <field name="legend_normal"/>
+                            <field name="legend_priority"/>
+                        </group>
                     </group>
                     <field name="description" placeholder="Add a description..."/>
                 </form>