[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>
This commit is contained in:
Nidhi Patel
2020-06-08 09:36:25 +00:00
committed by Alexandre Kühn
parent c9f93eb639
commit 91029b2b32
2 changed files with 10 additions and 1 deletions
+2 -1
View File
@@ -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>
+8
View File
@@ -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>