summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNisha patel <nit@odoo.com>2020-07-09 13:26:52 +0000
committerNisha patel <nit@odoo.com>2020-08-03 15:48:34 +0000
commit7f3a8d99287c835ee3ec703627c8ef906732c897 (patch)
tree4dfd1962023ba2a10058252cbe3f4d40f72b7d31
parent7ebe85f138f33bbb56514a88292679ee73625832 (diff)
[FIX] hr: Hide employee chat button in modals
Currently, the "Chat" button appears in the form view when it is displayed as a modal and on click sends to the app switcher because js_class is not loaded on the dialog when employee form view is opened through the one2many(dialog). For ex: in online appointment when on click on 'available emloyee' it will open the employee form view in dialog and there is a chat icon but it does not work. So in this commit, we fix this issue by hiding the "chat" button when the view is displayed as a modal. make a button visible based on action context and when form view is oped through the click of one2many then do not display the chat icon on modal dialog. closes odoo/odoo#55345 Taskid: 2291340 Closes: #54381 X-original-commit: e2bac64411f80a3fcf2c5d5d60ad3eccf6517e56 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
-rw-r--r--addons/hr/views/hr_employee_public_views.xml2
-rw-r--r--addons/hr/views/hr_employee_views.xml4
2 files changed, 3 insertions, 3 deletions
diff --git a/addons/hr/views/hr_employee_public_views.xml b/addons/hr/views/hr_employee_public_views.xml
index 108ff2c685d..d2001a8fc17 100644
--- a/addons/hr/views/hr_employee_public_views.xml
+++ b/addons/hr/views/hr_employee_public_views.xml
@@ -45,7 +45,7 @@
<label for="name" class="oe_edit_only"/>
<h1>
<field name="name" placeholder="Employee's Name" required="True"/>
- <a title="Chat" icon="fa-comments" href="#" class="ml8 o_employee_chat_btn" attrs="{'invisible': [('user_id','=', False)]}" role="button"><i class="fa fa-comments"/></a>
+ <a title="Chat" icon="fa-comments" href="#" class="ml8 o_employee_chat_btn" invisible="not context.get('chat_icon')" attrs="{'invisible': [('user_id','=', False)]}" role="button"><i class="fa fa-comments"/></a>
</h1>
<h2>
<field name="job_title" placeholder="Job Title" />
diff --git a/addons/hr/views/hr_employee_views.xml b/addons/hr/views/hr_employee_views.xml
index 5082a5dc424..959159ec295 100644
--- a/addons/hr/views/hr_employee_views.xml
+++ b/addons/hr/views/hr_employee_views.xml
@@ -77,7 +77,7 @@
<div class="oe_title">
<h1>
<field name="name" placeholder="Employee's Name" required="True"/>
- <a title="Chat" icon="fa-comments" href="#" class="ml8 o_employee_chat_btn" attrs="{'invisible': [('user_id','=', False)]}" role="button"><i class="fa fa-comments"/></a>
+ <a title="Chat" icon="fa-comments" href="#" class="ml8 o_employee_chat_btn" invisible="not context.get('chat_icon')" attrs="{'invisible': [('user_id','=', False)]}" role="button"><i class="fa fa-comments"/></a>
</h1>
<h2>
<field name="job_title" placeholder="Job Position" />
@@ -294,7 +294,7 @@
<field name="res_model">hr.employee</field>
<field name="view_mode">kanban,tree,form,activity</field>
<field name="domain">[]</field>
- <field name="context">{}</field>
+ <field name="context">{'chat_icon': True}</field>
<field name="view_id" eval="False"/>
<field name="search_view_id" ref="view_employee_filter"/>
<field name="help" type="html">