summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--addons/hr/__manifest__.py1
-rw-r--r--addons/hr/views/res_users.xml5
-rw-r--r--addons/mail_bot_hr/__manifest__.py16
-rw-r--r--addons/mail_bot_hr/views/res_users_views.xml28
-rw-r--r--addons/test_mail/__manifest__.py2
-rw-r--r--addons/test_mail/tests/test_performance.py2
6 files changed, 46 insertions, 8 deletions
diff --git a/addons/hr/__manifest__.py b/addons/hr/__manifest__.py
index 68bc368853c..78dbafe5450 100644
--- a/addons/hr/__manifest__.py
+++ b/addons/hr/__manifest__.py
@@ -20,7 +20,6 @@
'mail',
'resource',
'web',
- 'mail_bot',
],
'data': [
'security/hr_security.xml',
diff --git a/addons/hr/views/res_users.xml b/addons/hr/views/res_users.xml
index 22992df0244..2f3b0abbe9c 100644
--- a/addons/hr/views/res_users.xml
+++ b/addons/hr/views/res_users.xml
@@ -14,7 +14,6 @@
<field name="arch" type="xml">
<footer position="replace"/>
<h1 position="replace"/>
- <widget name="notification_alert" position="replace"/>
<xpath expr="//field[@name='image_1920']" position="replace"/>
<xpath expr="//field[@name='company_id']" position="attributes">
<attribute name="invisible">1</attribute>
@@ -38,16 +37,12 @@
<field name="model">res.users</field>
<field name="inherit_id" ref="res_users_view_form_simple_modif"/>
<field name="arch" type="xml">
- <xpath expr="//field[@name='odoobot_state']" position="attributes">
- <attribute name="attrs">{'readonly': [('can_edit', '=', False)]}</attribute>
- </xpath>
<form position="replace">
<form create="false" js_class="hr_employee_profile_form">
<field name="hr_presence_state" invisible="1"/>
<header>
<button name="preference_change_password" type="object" string="Change password" class="btn btn-secondary"/>
</header>
- <widget name="notification_alert" class="mb-0"/>
<sheet>
<div class="oe_button_box" name="button_box">
<button
diff --git a/addons/mail_bot_hr/__manifest__.py b/addons/mail_bot_hr/__manifest__.py
new file mode 100644
index 00000000000..714717a08f5
--- /dev/null
+++ b/addons/mail_bot_hr/__manifest__.py
@@ -0,0 +1,16 @@
+# -*- coding: utf-8 -*-
+{
+ 'name': "mail_bot_hr",
+ 'summary': """Bridge module between hr and mailbot.""",
+ 'description': """This module adds the OdooBot state and notifications in the user form modified by hr.""",
+ 'website': "https://www.odoo.com/page/discuss",
+ 'category': 'Productivity/Discuss',
+ 'version': '1.0',
+ 'depends': ['mail_bot', 'hr'],
+ 'application': False,
+ 'installable': True,
+ 'auto_install': True,
+ 'data': [
+ 'views/res_users_views.xml',
+ ],
+}
diff --git a/addons/mail_bot_hr/views/res_users_views.xml b/addons/mail_bot_hr/views/res_users_views.xml
new file mode 100644
index 00000000000..ee0e374f57b
--- /dev/null
+++ b/addons/mail_bot_hr/views/res_users_views.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" ?>
+<odoo>
+ <data>
+ <record id="res_users_view_form_simple_modif" model="ir.ui.view">
+ <field name="name">res.users.preferences.form.simplified.inherit</field>
+ <field name="model">res.users</field>
+ <field name="inherit_id" ref="hr.res_users_view_form_simple_modif" />
+ <field name="mode">primary</field>
+ <field name="arch" type="xml">
+ <widget name="notification_alert" position="replace" />
+ </field>
+ </record>
+
+ <record id="res_users_view_form_profile" model="ir.ui.view">
+ <field name="name">res.users.preferences.form.inherit</field>
+ <field name="model">res.users</field>
+ <field name="inherit_id" ref="hr.res_users_view_form_profile" />
+ <field name="arch" type="xml">
+ <xpath expr="//field[@name='odoobot_state']" position="attributes">
+ <attribute name="attrs">{'readonly': [('can_edit', '=', False)]}</attribute>
+ </xpath>
+ <sheet position="before">
+ <widget name="notification_alert" class="mb-0" />
+ </sheet>
+ </field>
+ </record>
+ </data>
+</odoo>
diff --git a/addons/test_mail/__manifest__.py b/addons/test_mail/__manifest__.py
index 18516b56e90..f539daaa69e 100644
--- a/addons/test_mail/__manifest__.py
+++ b/addons/test_mail/__manifest__.py
@@ -9,7 +9,7 @@
'description': """This module contains tests related to mail. Those are
contained in a separate module as it contains models used only to perform
tests independently to functional aspects of other models. """,
- 'depends': ['test_performance', 'mail', 'mail_bot'],
+ 'depends': ['test_performance', 'mail'],
'data': [
'security/ir.model.access.csv',
'security/test_mail_security.xml',
diff --git a/addons/test_mail/tests/test_performance.py b/addons/test_mail/tests/test_performance.py
index c79ae4abf65..de82171251b 100644
--- a/addons/test_mail/tests/test_performance.py
+++ b/addons/test_mail/tests/test_performance.py
@@ -286,7 +286,7 @@ class TestMailAPIPerformance(BaseMailPerformance):
}).create({})
composer.onchange_template_id_wrapper()
- with self.assertQueryCount(__system__=39, emp=44):
+ with self.assertQueryCount(__system__=40, emp=45):
composer.send_mail()
# remove created partner to ensure tests are the same each run