[IMP] Uniformize the icon in all kanban view (Google Hamburger)
[odoo/odoo.git] / addons / project_issue / project_issue_view.xml
index 2b2c485..95b401a 100644 (file)
@@ -2,7 +2,6 @@
 <openerp>
     <data>
 
-        <menuitem  id="menu_project_confi" name="Issues" parent="base.menu_definitions" sequence="2"/>
 
         <record model="ir.ui.view" id="project_issue_version_search_view">
             <field name="name">Issue Version</field>
@@ -18,7 +17,7 @@
             <field name="name">Issue Version</field>
             <field name="model">project.issue.version</field>
             <field name="arch" type="xml">
-                <form string="Issue Version" version="7.0">
+                <form string="Issue Version">
                     <group col="2">
                         <field name="name"/>
                         <field name="active"/>
               </p>
             </field>
         </record>
-        <menuitem action="project_issue_version_action" id="menu_project_issue_version_act" parent="menu_project_confi" groups="base.group_no_one"/>
+
+        <menuitem  action="project_issue_version_action" id="menu_project_confi" name="Issues Versions" parent="base.menu_definitions" sequence="2"/>
 
 
         <record model="ir.ui.view" id="project_issue_form_view">
             <field name="name">Project Issue Tracker Form</field>
             <field name="model">project.issue</field>
             <field name="arch" type="xml">
-                <form string="Issue" version="7.0">
+                <form string="Issue">
                 <header>
                     <field name="stage_id" widget="statusbar" clickable="True"
                         options="{'fold_field': 'fold'}"/>
                 </header>
                 <sheet string="Issue">
                     <label for="name" class="oe_edit_only"/>
-                    <h1>
-                        <field name="name" class="oe_inline"/>
-                        <field name="kanban_state" invisible='1'/>
-                        <button name="set_kanban_state_done" help="In Progress" attrs="{'invisible': [('kanban_state', 'in', ['done','blocked'])]}" type="object" icon="gtk-normal" class="oe_link oe_right"/>
-                        <button name="set_kanban_state_blocked" help="Ready for Next Stage" attrs="{'invisible': [('kanban_state', 'in', ['normal','blocked'])]}" type="object" icon="gtk-yes" class="oe_link oe_right"/>
-                        <button name="set_kanban_state_normal" help="Blocked" attrs="{'invisible': [('kanban_state', 'in', ['done','normal'])]}" type="object" icon="gtk-no" class="oe_link oe_right"/>
-                    </h1>
+                    <div class="row">
+                        <h1 class="col-xs-11">
+                            <field name="name" class="oe_inline"/>
+                        </h1>
+                        <div class="col-xs-1 text-right">
+                            <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>
                     <label for="categ_ids" class="oe_edit_only"/>
                     <field name="categ_ids" widget="many2many_tags"/>
                     <group>
                         <group>
-                            <field name="user_id" 
+                            <field name="user_id"
                                 context="{'default_groups_ref': ['base.group_user', 'base.group_partner_manager', 'project.group_project_user']}"/>
                             <field name="partner_id" on_change="onchange_partner_id(partner_id)"/>
                             <field name="email_from"/>
                             <label for="project_id"/>
                             <div>
                                 <field name="project_id" on_change="on_change_project(project_id)" class="oe_inline" context="{'default_use_issues':1}"/>
-                                <button name="case_escalate" string="⇒ Escalate" type="object" class="oe_link"
-                                        groups="base.group_user"/>
+                                <field name="can_escalate" invisible="1"/>
+                                <button name="case_escalate" string="Escalate" type="object" class="oe_link" attrs="{'invisible':[('can_escalate','=',False)]}" groups="base.group_user"/>
                             </div>
                         </group>
                         <group>
                             <field name="id"/>
                             <field name="version_id" groups="base.group_user"/>
-                            <field name="priority" groups="base.group_user"/>
+                            <field name="priority" groups="base.group_user" widget="priority"/>
                             <label for="task_id" groups="base.group_user"/>
                             <div groups="base.group_user">
                                 <field name="task_id" on_change="onchange_task_id(task_id)" class="oe_inline" context="{'default_project_id':project_id}"/>
                             <field name="description" placeholder="Add an internal note..." groups="base.group_user"/>
                         </page>
                         <page string="Extra Info" groups="project.group_project_manager,project.group_project_user">
-                            <group string="Statistics">
-                                <field name="day_open"/>
-                                <field name="day_close"/>
-                                <field name="working_hours_open" widget="float_time"/>
-                                <field name="working_hours_close" widget="float_time"/>
-                                <field name="inactivity_days"/>
-                                <field name="days_since_creation"/>
-                            </group>
-                            <group string="Status" groups="base.group_no_one">
-                                <field name="active"/>
+                            <group>
+                                <group string="Statistics">
+                                    <field name="day_open"/>
+                                    <field name="day_close"/>
+                                    <field name="working_hours_open" widget="float_time"/>
+                                    <field name="working_hours_close" widget="float_time"/>
+                                    <field name="inactivity_days"/>
+                                    <field name="days_since_creation"/>
+                                </group>
+                                <group string="Status" groups="base.group_no_one">
+                                    <field name="active"/>
+                                </group>
                             </group>
                         </page>
                     </notebook>
                 <search string="Issue Tracker Search">
                     <field name="name" string="Issue" filter_domain="['|', '|', '|', ('partner_id','child_of',self), ('description','ilike',self),('email_from','ilike',self),('name','ilike',self)]"/>
                     <field name="id"/>
-                    <field name="partner_id" filter_domain="[('partner_id', 'child_of', self)]"/>
-                    <filter string="Unassigned" name="unassigned" domain="[('user_id', '=', False)]"/>
-                    <filter string="New" name="draft" domain="[('stage_id.sequence', '=', 1)]"/>
-                    <separator/>
-                    <filter string="Unread Messages" name="message_unread" domain="[('message_unread','=',True)]"/>
-                    <separator/>
+                    <field name="partner_id" operator="child_of"/>
                     <field name="user_id"/>
                     <field name="project_id"/>
                     <field name="categ_ids"/>
                     <field name="stage_id" domain="[]"/>
-                    <group expand="0" string="Group By..." >
-                        <filter string="Responsible" name="group_user_id" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
-                        <filter string="Contact" name="group_partner_id" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
-                        <filter string="Project" name="group_project_id" icon="terp-folder-violet" domain="[]" context="{'group_by':'project_id'}"/>
-                        <filter string="Version" name="group_version" icon="terp-gtk-jump-to-rtl" domain="[]" context="{'group_by':'version_id'}"/>
-                        <filter string="Priority" name="group_priority" icon="terp-rating-rated" domain="[]" context="{'group_by':'priority'}"/>
-                        <filter string="Stage" name="group_stage_id" icon="terp-stage" domain="[]" context="{'group_by':'stage_id'}"/>
-                        <filter string="Creation Month" name="group_create_date" icon="terp-go-month" domain="[]" context="{'group_by':'create_date'}"/>
-                        <filter string="Last Post (weekly)" name="group_message_last_post" domain="[]" context="{'group_by':'message_last_post:week'}"/>
+                    <filter string="My Issues" domain="[('user_id','=',uid)]"/>
+                    <filter string="Unassigned" name="unassigned" domain="[('user_id', '=', False)]"/>
+                    <separator/>
+                    <filter string="New" name="draft" domain="[('stage_id.sequence', '=', 1)]"/>
+                    <separator/>
+                    <filter string="New Mail" name="message_unread" domain="[('message_unread','=',True)]"/>
+                    <group expand="0" string="Group By" >
+                        <filter string="Assigned to" name="Responsible" context="{'group_by':'user_id'}" />
+                        <filter string="Project" name="project" context="{'group_by':'project_id'}" />
+                        <filter string="Task" context="{'group_by':'task_id'}"/>
+                        <filter string="Priority" context="{'group_by':'priority'}" />
+                        <filter string="Stage" context="{'group_by':'stage_id'}"/>
+                        <filter string="Company" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
+                        <separator/>
+                        <filter string="Create Day" context="{'group_by':'create_date:day'}" help="Create Date"/>
+                        <filter string="Last Message" name="group_message_last_post" context="{'group_by':'message_last_post:week'}"/>
                     </group>
                 </search>
             </field>
             <field name="model">project.issue</field>
             <field name="arch" type="xml">
                 <kanban default_group_by="stage_id">
-                    <field name="stage_id"/>
+                    <field name="stage_id" options='{"group_by_tooltip": {"description": "Description", "legend_priority": "Use of stars"}}'/>
                     <field name="color"/>
                     <field name="priority"/>
                     <field name="user_email"/>
                     <field name="user_id"/>
                     <field name="date_deadline"/>
-                    <field name="kanban_state"/>
                     <field name="message_summary"/>
                     <templates>
                         <t t-name="kanban-tooltip">
                                 <div class="oe_dropdown_toggle oe_dropdown_kanban" groups="base.group_user">
                                     <span class="oe_e">i</span>
                                     <ul class="oe_dropdown_menu">
-                                        <t t-if="widget.view.is_action_enabled('edit')"><li><a type="edit">Edit...</a></li></t>
+                                        <t t-if="widget.view.is_action_enabled('edit')"><li><a type="edit">Edit Issue</a></li></t>
                                         <t t-if="widget.view.is_action_enabled('delete')"><li><a type="delete">Delete</a></li></t>
                                         <li><ul class="oe_kanban_colorpicker" data-field="color"/></li>
                                     </ul>
                                         <field name="partner_id"/> <br/>
                                         <field name="version_id"/>
                                     </div>
-                                    <div class="oe_kanban_footer_left">
-                                        <field name="categ_ids"/>
-                                        <div class="oe_right">
-                                            <span class="oe_kanban_highlight" groups="base.group_user">
-                                                <a t-if="record.kanban_state.raw_value === 'normal'" type="object" string="In Progress" name="set_kanban_state_done" class="oe_kanban_status"> </a>
-                                                <a t-if="record.kanban_state.raw_value === 'done'" type="object" string="Ready for next stage" name="set_kanban_state_blocked" class="oe_kanban_status oe_kanban_status_green"> </a>
-                                                <a t-if="record.kanban_state.raw_value === 'blocked'" type="object" string="Blocked" name="set_kanban_state_normal" class="oe_kanban_status oe_kanban_status_red"> </a>
-                                                <t t-set="priority" t-value="record.priority.raw_value || 5"/>
-                                                <a type="object" name="set_priority" args="['3']" t-if="priority gt 3" title="Normal Priority">
-                                                   <img src="/web/static/src/img/icons/star-off.png" width="16" height="16"/>
-                                                </a>
-                                                <a type="object" name="set_priority" args="['5']" t-if="priority lte 3" title="Normal Priority">
-                                                   <img t-attf-src="/web/static/src/img/icons/star-#{priority lte 3 ? 'on' : 'off'}.png" width="16" height="16"/>
-                                                </a>
-                                                <a type="object" name="set_priority" args="['2']" title="High Priority">
-                                                   <img t-attf-src="/web/static/src/img/icons/star-#{priority lte 2 ? 'on' : 'off'}.png" width="16" height="16"/>
-                                                </a>
-                                                <a type="object" name="set_priority" args="['1']" title="Highest Priority">
-                                                   <img t-attf-src="/web/static/src/img/icons/star-#{priority == 1 ? 'on' : 'off'}.png" width="16" height="16"/>
-                                                </a>
-                                            </span>
-                                            <t t-if="record.date_deadline.raw_value and record.date_deadline.raw_value lt (new Date())">
-                                                <span t-attf-class="oe_kanban_status oe_kaban_status_red"> </span>
-                                            </t>
-                                            <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"/>
+                                    <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"
+                                                options='{"states_legend": {"normal": "legend_normal", "blocked": "legend_blocked", "done": "legend_done"}}'/>
+                                            <field name="priority" widget="priority"/>
                                         </div>
                                     </div>
                                     <div class="oe_kanban_footer_left">
+                                        <field name="categ_ids"/>
                                         <t t-raw="record.message_summary.raw_value"/>
                                     </div>
                                 </div>
             </field>
         </record>
 
+        <record model="ir.ui.view" id="project_issue_graph_view">
+            <field name="name">Project Issue Tracker Graph</field>
+            <field name="model">project.issue</field>
+            <field name="arch" type="xml">
+                <graph string="Project Issues" type="bar">
+                    <field name="project_id" type="row"/>
+                    <field name="create_date" interval="month" type="col"/>
+                </graph>
+            </field>
+        </record>
+
 
         <!-- Feature Requests -->
         <record model="ir.ui.view" id="project_feature_tree_view">
             <field name="name">Issues</field>
             <field name="view_mode">kanban,tree,form,calendar,graph</field>
             <field name="context">{
-                    'search_default_project_id': [active_id], 
+                    'search_default_project_id': [active_id],
                     'default_project_id': active_id,
                 }
             </field>
             <field name="help" type="html">
                 <p>
-                    The OpenERP issues tacker allows you to efficiantly manage things
+                    The Odoo issues tacker allows you to efficiently manage things
                     like internal requests, software development bugs, customer
                     complaints, project troubles, material breakdowns, etc.
                 </p>
             <field name="model">project.project</field>
             <field name="inherit_id" ref="project.edit_project"/>
             <field name="arch" type="xml">
+                <xpath expr='//div[@name="options_active"]' position="attributes">
+                    <attribute name="invisible">0</attribute>
+                </xpath>
                 <xpath expr='//div[@name="options_active"]' position='inside'>
-                    <field name="use_issues" class="oe_inline"
-                            on_change="on_change_use_tasks_or_issues(use_tasks, use_issues)"/>
-                    <label for="use_issues"/>
+                    <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"/>
+                    </div>
                 </xpath>
                 <xpath expr='//div[@name="buttons"]' position='inside'>
-                    <button class="oe_inline oe_stat_button" type="action" attrs="{'invisible':[('use_issues','=', 0)]}" 
+                    <button class="oe_inline oe_stat_button" type="action" attrs="{'invisible':[('use_issues','=', False)]}"
                         name="%(act_project_project_2_project_issue_all)d" icon="fa-bug">
-                        <field string="Issues" name="total_issue_count" widget="statinfo"/>
+                        <field string="Issues" name="issue_count" widget="statinfo" options="{'label_field': 'label_issues'}"/>
                     </button>
                 </xpath>
                 <xpath expr='//page[@name="project_stages"]' position="attributes">
                     <field name="use_issues"/>
                     <field name="issue_ids" invisible="1"/>
                 </field>
-                <xpath expr="//div[contains(@class, 'oe_kanban_project_list')]" position="inside">
-                    <a t-if="record.use_issues.raw_value" style="margin-right: 10px"
+                <xpath expr="//div[contains(@class, 'oe_kanban_project_list')]/a" position="after">
+                    <a t-if="record.use_issues.raw_value" style="margin-right: 20px" class="pull-right"
                         name="%(act_project_project_2_project_issue_all)d" type="action">
-                        <t t-raw="record.issue_ids.raw_value.length"/>
-                        <span t-if="record.issue_ids.raw_value.length == 1">Issue</span>
-                        <span t-if="record.issue_ids.raw_value.length > 1">Issues</span>
+                        <t t-raw="record.issue_ids.raw_value.length"/> <field name="label_issues"/>
+                        <field name="monthly_issues" widget="sparkline_bar" options="{'delayIn': '1000'}">
+                            Closed Issues
+                        </field>
                     </a>
                 </xpath>
+                <xpath expr="//div[contains(@class, 'oe_kanban_project_list')]/div" position="replace">
+                     <div t-if="!(record.use_tasks.raw_value and record.task_count.raw_value gt 0) and !(record.use_issues.raw_value and record.issue_ids.raw_value.length gt 0)" style="margin-top: 6px;margin-left:20px;">
+                         <img src="/project/static/src/img/top_left_arrow.png" style="margin-top: -8px; width: 22px;" />
+                         <span>No activity yet, click to enter in the project.</span>
+                     </div>
+                </xpath>
             </field>
         </record>
 
             <field name="view_mode">kanban,tree,form,calendar,graph</field>
             <field name="help" type="html">
                 <p>
-                    The OpenERP issues tacker allows you to efficiantly manage things
+                    The Odoo issues tacker allows you to efficiently manage things
                     like internal requests, software development bugs, customer
                     complaints, project troubles, material breakdowns, etc.
                 </p>
             <field name="priority" eval="50"/>
             <field name="arch" type="xml">
                 <xpath expr="//div[@name='buttons']" position="inside">
-                    <button class="oe_inline" type="action" string="Issues"
-                        attrs="{'invisible': [('customer', '=', False)]}"
-                        name="%(action_view_issues)d"
+                    <button class="oe_inline oe_stat_button" type="action" name="%(action_view_issues)d"
                         context="{'search_default_partner_id': active_id, 'default_partner_id': active_id}"
-                        groups="project.group_project_user"/>
+                        attrs="{'invisible': [('customer', '=', False)]}"
+                        icon="fa-bug" groups="project.group_project_user">
+                        <field  string="Issues" name="issue_count" widget="statinfo"/>
+                    </button>
+
+
                 </xpath>
             </field>
         </record>