summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorNidhi Patel <nia@odoo.com>2020-04-08 08:51:21 +0000
committerAlexandre Kühn <aku@odoo.com>2020-06-08 09:36:25 +0000
commit91029b2b32dbd94292a9db06e2a8fd9c248d2df8 (patch)
treea8a51fca6eebb1020974f37ade63e2f53f5d54d0 /addons
parentc9f93eb6396159a4fd46e9767c075d6e28f888d6 (diff)
[FIX] mail: channel `#general` with default messages
Before this commit, when starting a new database with demo data, the default channel `#general` had no messages initially. The demo data defines default messages in this channel, but were incorrectly linked to this channel, resulting in this channel containing no messages initially. The messages did not define `channel_ids`, so it was considered empty. This field is essential for displaying the message in channel, so by being omitted these messages are not properly linked to channels. This commit fixes the issue by correctly linked this demo messages to this demo channel, so that `#general` now contains some messages initially. This commit also removes unused context `mail_notify_noemail`. Task-Id 2186300 closes odoo/odoo#49539 Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Diffstat (limited to 'addons')
-rw-r--r--addons/mail/data/mail_channel_data.xml3
-rw-r--r--addons/mail/data/mail_channel_demo.xml8
2 files changed, 10 insertions, 1 deletions
diff --git a/addons/mail/data/mail_channel_data.xml b/addons/mail/data/mail_channel_data.xml
index 12d94b8e3e6..1f6a89308c2 100644
--- a/addons/mail/data/mail_channel_data.xml
+++ b/addons/mail/data/mail_channel_data.xml
@@ -9,9 +9,10 @@
</record>
<!-- notify all employees of module installation -->
- <record model="mail.message" id="module_install_notification" context="{'mail_notify_noemail': True}">
+ <record model="mail.message" id="module_install_notification">
<field name="model">mail.channel</field>
<field name="res_id" ref="mail.channel_all_employees"/>
+ <field name="channel_ids" eval="[(4, ref('mail.channel_all_employees'))]"/>
<field name="message_type">email</field>
<field name="subtype_id" ref="mail.mt_comment"/>
<field name="subject">Welcome to Odoo!</field>
diff --git a/addons/mail/data/mail_channel_demo.xml b/addons/mail/data/mail_channel_demo.xml
index 063e462c637..d0965bae8d5 100644
--- a/addons/mail/data/mail_channel_demo.xml
+++ b/addons/mail/data/mail_channel_demo.xml
@@ -23,6 +23,7 @@
<field name="body"><![CDATA[<p>Selling a training session and selling the products after the training session is more efficient than directly selling a pack with the training session and the products.</p>]]></field>
<field name="message_type">comment</field>
<field name="subtype_id" ref="mt_comment"/>
+ <field name="channel_ids" eval="[(4, ref('mail.channel_1'))]"/>
<field name="author_id" ref="base.partner_demo"/>
<field name="date" eval="(DateTime.today() - timedelta(days=5)).strftime('%Y-%m-%d %H:%M')"/>
</record>
@@ -32,6 +33,7 @@
<field name="body"><![CDATA[<p>I noted I can not manage efficiently my pipeline when I have more than 50 opportunities in the qualification stage.</p><p>Any advice on this? How do you organize your activities with more than 50 opportunities?</p>]]></field>
<field name="message_type">comment</field>
<field name="subtype_id" ref="mt_comment"/>
+ <field name="channel_ids" eval="[(4, ref('mail.channel_1'))]"/>
<field name="author_id" ref="base.partner_root"/>
<field name="date" eval="(DateTime.today() - timedelta(days=4)).strftime('%Y-%m-%d %H:%M')"/>
</record>
@@ -42,6 +44,7 @@
<field name="message_type">comment</field>
<field name="parent_id" ref="mail_message_channel_1_2"/>
<field name="subtype_id" ref="mt_comment"/>
+ <field name="channel_ids" eval="[(4, ref('mail.channel_1'))]"/>
<field name="author_id" ref="base.partner_demo"/>
<field name="date" eval="(DateTime.today() - timedelta(days=3)).strftime('%Y-%m-%d %H:%M')"/>
</record>
@@ -50,6 +53,7 @@
<record id="mail_message_channel_whole_1" model="mail.message">
<field name="model">mail.channel</field>
<field name="res_id" ref="mail.channel_all_employees"/>
+ <field name="channel_ids" eval="[(4, ref('mail.channel_all_employees'))]"/>
<field name="body"><![CDATA[
<p>
Great news!<br/>
@@ -65,6 +69,7 @@
<record id="mail_message_channel_whole_2" model="mail.message">
<field name="model">mail.channel</field>
<field name="res_id" ref="mail.channel_all_employees"/>
+ <field name="channel_ids" eval="[(4, ref('mail.channel_all_employees'))]"/>
<field name="body"><![CDATA[<p>Your monthly meal vouchers arrived. You can get them at the HR's office.</p>
<p>This month you also get 250 EUR of eco-vouchers if you have been in the company for more than a year.</p>]]></field>
<field name="message_type">comment</field>
@@ -74,6 +79,7 @@
<record id="mail_message_channel_whole_2_1" model="mail.message">
<field name="model">mail.channel</field>
<field name="res_id" ref="channel_all_employees"/>
+ <field name="channel_ids" eval="[(4, ref('mail.channel_all_employees'))]"/>
<field name="body"><![CDATA[<p>Thanks! Could you please remind me where is Christine's office, if I may ask? I'm new here!</p>]]></field>
<field name="parent_id" ref="mail_message_channel_whole_2"/>
<field name="message_type">comment</field>
@@ -83,6 +89,7 @@
<record id="mail_message_channel_whole_2_2" model="mail.message">
<field name="model">mail.channel</field>
<field name="res_id" ref="channel_all_employees"/>
+ <field name="channel_ids" eval="[(4, ref('mail.channel_all_employees'))]"/>
<field name="body"><![CDATA[<p>Building B3, second floor on the right :-).</p>]]></field>
<field name="parent_id" ref="mail_message_channel_whole_2"/>
<field name="message_type">comment</field>
@@ -147,6 +154,7 @@
]]></field>
<field name="message_type">comment</field>
<field name="subtype_id" ref="mt_comment"/>
+ <field name="channel_ids" eval="[(4, ref('mail.channel_2'))]"/>
<field name="author_id" ref="base.partner_demo"/>
<field name="date" eval="(DateTime.today() - timedelta(days=3)).strftime('%Y-%m-%d %H:%M')"/>
</record>