[MERGE] Another batch of Bugfixes from 6.1
[odoo/odoo.git] / addons / project_issue / project_issue_view.xml
index bb15f8c..279fec2 100644 (file)
@@ -4,43 +4,6 @@
 
         <menuitem  id="menu_project_confi" name="Issues" parent="base.menu_definitions" sequence="2"/>
 
-        <!-- Project issue Read/Unread actions -->
-        <record id="actions_server_project_issue_unread" model="ir.actions.server">
-            <field name="name">Mark unread</field>
-            <field name="condition">True</field>
-            <field name="type">ir.actions.server</field>
-            <field name="model_id" ref="model_project_issue"/>
-            <field name="state">code</field>
-            <field name="code">self.message_check_and_set_unread(cr, uid, context.get('active_ids'), context=context)</field>
-        </record>
-        <record id="action_project_issue_unread" model="ir.values">
-            <field name="name">action_project_issue_unread</field>
-            <field name="action_id" ref="actions_server_project_issue_unread"/>
-            <field name="value" eval="'ir.actions.server,' + str(ref('actions_server_project_issue_unread'))"/>
-            <field name="key">action</field>
-            <field name="model_id" ref="model_project_issue"/>
-            <field name="model">project.issue</field>
-            <field name="key2">client_action_multi</field>
-        </record>
-
-        <record id="actions_server_project_issue_read" model="ir.actions.server">
-            <field name="name">Mark read</field>
-            <field name="condition">True</field>
-            <field name="type">ir.actions.server</field>
-            <field name="model_id" ref="model_project_issue"/>
-            <field name="state">code</field>
-            <field name="code">self.message_check_and_set_read(cr, uid, context.get('active_ids'), context=context)</field>
-        </record>
-        <record id="action_project_issue_read" model="ir.values">
-            <field name="name">action_project_issue_read</field>
-            <field name="action_id" ref="actions_server_project_issue_read"/>
-            <field name="value" eval="'ir.actions.server,' + str(ref('actions_server_project_issue_read'))"/>
-            <field name="key">action</field>
-            <field name="model_id" ref="model_project_issue"/>
-            <field name="model">project.issue</field>
-            <field name="key2">client_action_multi</field>
-        </record>
-
         <record model="ir.ui.view" id="project_issue_version_search_view">
             <field name="name">Issue Version</field>
             <field name="model">project.issue.version</field>
             <field name="arch" type="xml">
                 <form string="Issue" version="7.0">
                 <header>
-                    <span groups="base.group_user">
-                        <button name="case_close" string="Done" type="object"
-                                states="open"/>
-                         <button name="case_close" string="Done" type="object"
-                                states="draft,pending"/>
-                        <button name="case_escalate" string="Escalate" type="object"
-                                states="draft,open,pending"/>
-                        <button name="case_cancel" string="Cancel" type="object"
-                                states="draft,open,pending"/>
-                    </span>
+                    <button name="case_close" string="Done" type="object" 
+                            states="open" groups="base.group_user"/>
+                    <button name="case_close" string="Done" type="object"
+                            states="draft,pending" groups="base.group_user"/>
+                    <button name="case_cancel" string="Cancel" type="object"
+                            states="draft,open,pending" groups="base.group_user"/>
                     <field name="stage_id" widget="statusbar" clickable="True"/>
                 </header>
                 <sheet string="Issue">
                     <label for="name" class="oe_edit_only"/>
                     <h1><field name="name"/></h1>
                     <group>
-                        <group>
+                        <group groups="base.group_user">
                             <field name="user_id"/>
                             <field name="partner_id"  on_change="onchange_partner_id(partner_id, email_from)"/>
                             <field name="email_from"/>
+                            <label for="project_id" groups="base.group_user"/>
+                            <div groups="base.group_user">
+                                <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" states="draft,open,pending" class="oe_link"/>
+                            </div>
                         </group>
                         <group>
-                            <field name="priority"/>
-                            <field name="project_id" required="True" on_change="on_change_project(project_id)" context="{'default_use_issues':1}"/>
-                            <label for="task_id"/>
-                            <div>
+                            <field name="categ_ids" widget="many2many_tags"/>
+                            <field name="version_id" groups="base.group_user"/>
+                            <field name="priority" groups="base.group_user"/>
+                            <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="progress" widget="progressbar" attrs="{'invisible':[('task_id','=',False)]}" class="oe_inline"/>
                             </div>
-                            <field name="categ_ids" widget="many2many_tags"/>
                         </group>
                     </group>
                     <notebook>
                         <page string="Description">
-                            <group>
-                                <group>
-                                    <field name="version_id" widget="selection"/>
-                                </group>
-                            </group>
-                            <field name="description" placeholder="Add a description..."/>
+                            <field name="description" placeholder="Add an internal note..." groups="base.group_user"/>
                         </page>
                         <page string="Extra Info" groups="base.group_no_one">
                             <group col="4" colspan="4">
                                 <field name="id"/>
                                 <field name="active"/>
                             </group>
-                            <group colspan="4" col="4">
+                            <group colspan="4" col="4" invisible="1">
                                 <separator string="Status" colspan="4"/>
                                 <field name="state" groups="base.group_no_one" string="Status"/>
                             </group>
                     </notebook>
                 </sheet>
                 <div class="oe_chatter">
+                    <field name="message_follower_ids" widget="mail_followers" groups="base.group_user"/>
                     <field name="message_ids" widget="mail_thread"/>
-                    <field name="message_follower_ids" widget="mail_followers"/>
                 </div>
                 </form>
             </field>
             <field name="name">Project Issue Tracker Tree</field>
             <field name="model">project.issue</field>
             <field name="arch" type="xml">
-                <tree string="Issue Tracker Tree" fonts="bold:needaction_pending==True" colors="black:state=='open';blue:state=='pending';grey:state in ('cancel', 'done')">
-                    <field name="needaction_pending" invisible="1"/>
+                <tree string="Issue Tracker Tree" fonts="bold:message_unread==True" colors="black:state=='open';blue:state=='pending';grey:state in ('cancel', 'done')">
+                    <field name="message_unread" invisible="1"/>
                     <field name="id"/>
                     <field name="create_date" groups="base.group_no_one"/>
                     <field name="name"/>
                     <field name="user_id"/>
                     <field name="progress" widget="progressbar" attrs="{'invisible':[('task_id','=',False)]}"/>
                     <field name="stage_id" widget="selection" readonly="1"/>
-                    <field name="state" groups="base.group_no_one"/>
+                    <field name="state" invisible="1"/>
                     <field name="categ_ids" invisible="1"/>
                     <field name="task_id" invisible="1"/>
                 </tree>
                 <search string="Issue Tracker Search">
                     <field name="name" string="Issue" filter_domain="['|', '|',('partner_id','ilike',self),('email_from','ilike',self),('name','ilike',self)]"/>
                     <field name="id"/>
-                    <filter icon="terp-mail-message-new" string="Inbox" help="Unread messages" name="needaction_pending" domain="[('needaction_pending','=',True)]"/>
+                    <filter icon="terp-mail-message-new" string="Unread Messages" name="message_unread" domain="[('message_unread','=',True)]"/>
                     <separator/>
                     <filter string="New" icon="terp-document-new" domain="[('state','=','draft')]" help="New Issues"/>
                     <filter string="To Do" domain="[('state','=','open')]" help="To Do Issues" icon="terp-check"/>
                     <filter string="Unassigned Issues" domain="[('user_id','=',False)]"  help="Unassigned Issues" icon="terp-personal-" />
                     <field name="user_id"/>
                     <field name="project_id"/>
+                    <field name="categ_ids"/>
                     <group expand="0" string="Group By..." >
                         <filter string="Responsible" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
                         <filter string="Contact" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
                         <filter string="Project"  icon="terp-folder-violet" domain="[]" context="{'group_by':'project_id'}"/>
                         <filter string="Version" icon="terp-gtk-jump-to-rtl" domain="[]" context="{'group_by':'version_id'}"/>
-                        <filter string="Category" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'categ_id'}"/>
                         <filter string="Priority" icon="terp-rating-rated" domain="[]" context="{'group_by':'priority'}"/>
                         <filter string="Stage" icon="terp-stage" domain="[]" context="{'group_by':'stage_id'}"/>
-                        <filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
                         <filter string="Month" icon="terp-go-month" domain="[]" context="{'group_by':'create_date'}" help="Creation Month"/>
                     </group>
                 </search>
             <field name="model">project.issue</field>
             <field name="arch" type="xml">
                 <kanban default_group_by="stage_id">
+                    <field name="stage_id"/>
                     <field name="color"/>
                     <field name="priority"/>
                     <field name="user_email"/>
                            </ul>
                         </t>
                         <t t-name="kanban-box">
-                            <div t-attf-class="oe_kanban_color_#{kanban_getcolor(record.color.raw_value)} oe_kanban_card oe_kanban_global_click">
-                                <div class="oe_dropdown_toggle oe_dropdown_kanban">
+                            <div t-attf-class="oe_kanban_color_#{kanban_getcolor(record.color.raw_value)} oe_kanban_card oe_kanban_global_click oe_semantic_html_override">
+                                <div class="oe_dropdown_toggle oe_dropdown_kanban" groups="base.group_user">
                                     <span class="oe_e">i</span>
                                     <ul class="oe_dropdown_menu">
-                                        <li><a type="edit" >Edit...</a></li>
-                                        <li><a type="delete">Delete</a></li>
+                                        <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('delete')"><li><a type="delete">Delete</a></li></t>
                                         <li><ul class="oe_kanban_colorpicker" data-field="color"/></li>
                                     </ul>
                                 </div>
                                         <field name="version_id"/>
                                     </div>
                                     <div class="oe_kanban_footer_left">
-                                        <div class="oe_left oe_tags">
-                                            <t t-foreach="record.categ_ids.raw_value" t-as="categ_id">
-                                                <span class="oe_tag" t-att-data-categ_id="categ_id"></span>
-                                            </t>
-                                        </div>
+                                        <field name="categ_ids"/>
                                         <div class="oe_right">
-                                            <span class="oe_kanban_highlight">
+                                            <span class="oe_kanban_highlight" groups="base.group_user">
                                                 <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"/>
             <field name="name">Project Issue- Feature Tracker Tree</field>
             <field name="model">project.issue</field>
             <field name="arch" type="xml">
-                <tree string="Feature Tracker Tree" fonts="bold:needaction_pending==True" colors="red:state=='open';black:state in ('draft', 'cancel','done','pending')">
+                <tree string="Feature Tracker Tree" fonts="bold:message_unread==True" colors="red:state=='open';black:state in ('draft', 'cancel','done','pending')">
                     <field name="id"/>
-                    <field name="needaction_pending" invisible="1"/>
+                    <field name="message_unread" invisible="1"/>
                     <field name="name" string="Feature description"/>
                     <field name="partner_id"/>
                     <field name="priority" string="Priority"/>
             </field>
         </record>
 
-        <act_window id="act_project_project_2_project_issue_all"
-            name="Issues"
-            src_model="project.project"
-            res_model="project.issue"
-            view_type="form"
-            view_mode="kanban,tree,form,calendar,graph"
-            context="{'search_default_project_id': [active_id], 'default_project_id': active_id}"/>
+        <record id="act_project_project_2_project_issue_all" model="ir.actions.act_window">
+            <field name="res_model">project.issue</field>
+            <field name="view_type">form</field>
+            <field name="name">Issues</field>
+            <field name="view_mode">kanban,tree,form,calendar,graph</field>
+            <field name="context">{'search_default_project_id': [active_id], 'default_project_id': active_id}</field>
+        </record>
 
         <!-- Project -->
         <record id="view_project_form_inherited" model="ir.ui.view">
             <field name="model">project.project</field>
             <field name="inherit_id" ref="project.edit_project"/>
             <field name="arch" type="xml">
-                <xpath expr='//tr[@name="use_tasks_row"]' position='after'>
-                    <tr>
-                        <td><group><field name="use_issues"/></group></td>
-                        <td><button icon="terp-gtk-go-back-rtl" name="%(act_project_project_2_project_issue_all)d" string="Issues" type="action" attrs="{'invisible':[('use_issues','=', 0)]}"/></td>
-                    </tr>
+                <xpath expr='//div[@name="options_active"]' position='inside'>
+                    <field name="use_issues" class="oe_inline"/>
+                    <label for="use_issues"/>
+                </xpath>
+                <xpath expr='//div[@name="buttons"]' position='inside'>
+                    <button name="%(act_project_project_2_project_issue_all)d" string="Issues" type="action" attrs="{'invisible':[('use_issues','=', 0)]}"/>
                 </xpath>
                 <field name="priority" position="before">
                     <field name="project_escalation_id"/>
                     <field name="issue_count" invisible="1"/>
                 </field>
                 <xpath expr="//div[contains(@class, 'oe_kanban_project_list')]" position="inside">
-                    <a t-if="record.use_issues.raw_value"
+                    <a t-if="record.use_issues.raw_value" style="margin-right: 10px"
                         name="%(act_project_project_2_project_issue_all)d" type="action">
-                        Issues(<field name="issue_count"/>)</a>
+                        <span t-if="record.issue_count.raw_value gt 1"><field name="issue_count"/> Issues</span>
+                        <span t-if="record.issue_count.raw_value lt 2"><field name="issue_count"/> Issue</span>
+                    </a>
                 </xpath>
             </field>
         </record>
             <field name="inherit_id" ref="project.analytic_account_inherited_form"/>
             <field eval="18" name="priority"/>
             <field name="arch" type="xml">
-                <xpath expr='//separator[@name="project_sep"]' position='replace'>
-                    <separator colspan="4" string="Project Management" name="project_sep"/> <!-- removal of invisible attribute -->
-                </xpath>
-                <xpath expr='//separator[@name="project_sep"]' position='after'>
+                <xpath expr='//div[@name="project"]' position='inside'>
                     <field name="use_issues"/>
+                    <label for="use_issues"/>
                 </xpath>
             </field>
         </record>