[RENAME] mail, portal: updated actions and views xml ids
for channel-related stuff. mail.channel views as well as timeline views and actions have been renamed. Now the names follow the guidelines and will be used in the upcoming refactoring of mail and chat.
This commit is contained in:
@@ -819,7 +819,7 @@
|
||||
</div>
|
||||
<div class="col-md-4 col-xs-12 text-center o_planner_white_box">
|
||||
<div class="panel">
|
||||
<a t-att-href="prepare_backend_url('mail.action_mail_inbox_feeds')"><i class="fa-2x" data-icon="">
|
||||
<a t-att-href="prepare_backend_url('mail.mail_message_action_inbox')"><i class="fa-2x" data-icon="">
|
||||
</i><br/> Follow the day-to-day activites to be sure that everyone is using it
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@@ -152,7 +152,7 @@
|
||||
<field name="description">Follow mail.channels to receive news</field>
|
||||
<field name="computation_mode">python</field>
|
||||
<field name="compute_code">result = pool.get('mail.followers').search(cr, uid, [('res_model', '=', 'mail.channel'), ('partner_id', '=', object.user_id.partner_id.id)], count=True, context=context)</field>
|
||||
<field name="action_id" eval="ref('mail.action_view_groups')" />
|
||||
<field name="action_id" eval="ref('mail.mail_channel_action_view')" />
|
||||
</record>
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record model="ir.actions.act_window" id="mail.action_mail_inbox_feeds">
|
||||
<record model="ir.actions.act_window" id="mail.mail_message_action_inbox">
|
||||
<field name="name">Inbox</field>
|
||||
<field name="res_model">mail.message</field>
|
||||
<field name="view_type">form</field>
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
<record id="action_client_messaging_menu" model="ir.actions.client">
|
||||
<field name="name">Open Messaging Menu</field>
|
||||
<field name="tag">reload</field>
|
||||
<field name="params" eval="{'menu_id': ref('mail.mail_feeds_main')}"/>
|
||||
<field name="params" eval="{'menu_id': ref('mail.mail_thread_menu_root')}"/>
|
||||
</record>
|
||||
<record id="base.open_menu" model="ir.actions.todo">
|
||||
<field name="action_id" ref="action_client_messaging_menu"/>
|
||||
|
||||
@@ -23,7 +23,7 @@ ClientAction (ir.actions.client)
|
||||
|
||||
.. code-block:: xml
|
||||
|
||||
<record id="action_mail_inbox_feeds" model="ir.actions.client">
|
||||
<record id="mail_message_action_inbox" model="ir.actions.client">
|
||||
<field name="name">Inbox</field>
|
||||
<field name="tag">mail.wall</field>
|
||||
<field name="res_model">mail.message</field>
|
||||
|
||||
@@ -64,7 +64,7 @@ class MailGroup(models.Model):
|
||||
@api.model
|
||||
def create(self, vals):
|
||||
# get parent menu
|
||||
menu_parent = self.env.ref('mail.mail_group_root')
|
||||
menu_parent = self.env.ref('mail.mail_channel_menu_root')
|
||||
|
||||
# Create menu id
|
||||
menu = self.env['ir.ui.menu'].sudo().create({'name': vals['name'], 'parent_id': menu_parent.id})
|
||||
@@ -77,7 +77,7 @@ class MailGroup(models.Model):
|
||||
group.alias_id.write({"alias_force_thread_id": group.id, 'alias_parent_thread_id': group.id})
|
||||
|
||||
# Create action window for this group and link the menu to it
|
||||
inbox_ref = self.env.ref('mail.action_mail_group_feeds')
|
||||
inbox_ref = self.env.ref('mail.mail_channel_action_timeline')
|
||||
search_ref = self.env.ref('mail.view_message_search')
|
||||
act_domain = [('model', '=', 'mail.channel'), ('res_id', '=', group.id)]
|
||||
act_context = {'default_model': 'mail.channel',
|
||||
|
||||
@@ -497,7 +497,7 @@ class MailThread(models.AbstractModel):
|
||||
""" When redirecting towards the Inbox, choose which action xml_id has
|
||||
to be fetched. This method is meant to be inherited, at least in portal
|
||||
because portal users have a different Inbox action than classic users. """
|
||||
return 'mail.action_mail_inbox_feeds'
|
||||
return 'mail.mail_message_action_inbox'
|
||||
|
||||
@api.model
|
||||
def message_redirect_action(self):
|
||||
|
||||
@@ -64,7 +64,7 @@ class TestMailFeatures(TestMail):
|
||||
|
||||
def test_inbox_redirection_basic(self):
|
||||
""" Inbox redirection: no params, Inbox """
|
||||
inbox_act_id = self.ref('mail.action_mail_inbox_feeds')
|
||||
inbox_act_id = self.ref('mail.mail_message_action_inbox')
|
||||
action = self.env['mail.thread'].with_context({'params': {}}).sudo(self.user_employee).message_redirect_action()
|
||||
self.assertEqual(
|
||||
action.get('type'), 'ir.actions.act_window',
|
||||
@@ -109,7 +109,7 @@ class TestMailFeatures(TestMail):
|
||||
def test_inbox_redirection_message_inbox(self):
|
||||
""" Inbox redirection: message without read access: Inbox """
|
||||
message = self.group_pigs.message_post(body='My body', partner_ids=[self.user_employee.partner_id.id], message_type='comment', subtype='mail.mt_comment')
|
||||
inbox_act_id = self.ref('mail.action_mail_inbox_feeds')
|
||||
inbox_act_id = self.ref('mail.mail_message_action_inbox')
|
||||
action = self.env['mail.thread'].with_context({
|
||||
'params': {'message_id': message.id}
|
||||
}).sudo(self.user_public).message_redirect_action()
|
||||
@@ -125,7 +125,7 @@ class TestMailFeatures(TestMail):
|
||||
@mute_logger('openerp.models')
|
||||
def test_inbox_redirection_document_inbox(self):
|
||||
""" Inbox redirection: document without read access: Inbox """
|
||||
inbox_act_id = self.ref('mail.action_mail_inbox_feeds')
|
||||
inbox_act_id = self.ref('mail.mail_message_action_inbox')
|
||||
action = self.env['mail.thread'].with_context({
|
||||
'params': {'model': 'mail.channel', 'res_id': self.group_pigs.id}
|
||||
}).sudo(self.user_public).message_redirect_action()
|
||||
|
||||
@@ -2,15 +2,16 @@
|
||||
<openerp>
|
||||
<data>
|
||||
<!-- this record will be dynamically adapted to each new menu created -->
|
||||
<record model="ir.actions.act_window" id="action_mail_group_feeds">
|
||||
<record id="mail_channel_action_timeline" model="ir.actions.act_window">
|
||||
<field name="name">Discussion Group</field>
|
||||
<field name="res_model">mail.message</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">timeline</field>
|
||||
</record>
|
||||
|
||||
<!-- Group Kanban View !-->
|
||||
<record model="ir.ui.view" id="view_group_kanban">
|
||||
<!-- mail.channel -->
|
||||
|
||||
<record id="mail_channel_view_kanban" model="ir.ui.view">
|
||||
<field name="name">mail.channel.kanban</field>
|
||||
<field name="model">mail.channel</field>
|
||||
<field name="priority" eval="10"/>
|
||||
@@ -57,8 +58,7 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Group Form View !-->
|
||||
<record model="ir.ui.view" id="view_group_form">
|
||||
<record id="mail_channel_view_form" model="ir.ui.view">
|
||||
<field name="name">mail.channel.form</field>
|
||||
<field name="model">mail.channel</field>
|
||||
<field name="priority" eval="10"/>
|
||||
@@ -114,8 +114,7 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Group List View !-->
|
||||
<record model="ir.ui.view" id="view_group_tree">
|
||||
<record id="mail_channel_view_tree" model="ir.ui.view">
|
||||
<field name="name">mail.channel.tree</field>
|
||||
<field name="model">mail.channel</field>
|
||||
<field name="priority" eval="10"/>
|
||||
@@ -126,8 +125,7 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Group Search View !-->
|
||||
<record model="ir.ui.view" id="view_group_search">
|
||||
<record id="mail_channel_view_search" model="ir.ui.view">
|
||||
<field name="name">mail.channel.search</field>
|
||||
<field name="model">mail.channel</field>
|
||||
<field name="priority" eval="10"/>
|
||||
@@ -138,17 +136,22 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- group record !-->
|
||||
<record id="action_view_groups" model="ir.actions.act_window">
|
||||
<record id="mail_channel_action_view" model="ir.actions.act_window">
|
||||
<field name="name">Join a group</field>
|
||||
<field name="res_model">mail.channel</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">kanban,tree,form</field>
|
||||
<field name="search_view_id" ref="view_group_search"/>
|
||||
<field name="search_view_id" ref="mail_channel_view_search"/>
|
||||
</record>
|
||||
|
||||
<!-- left-side menu: Groups !-->
|
||||
<menuitem id="mail_group_root" parent="mail_feeds_main" sequence="2" name="Channel"/>
|
||||
<menuitem id="mail_allgroups" parent="mail_group_root" sequence="100" action="action_view_groups"/>
|
||||
<menuitem id="mail_channel_menu_root" parent="mail_thread_menu_root" sequence="2" name="Channels"/>
|
||||
<menuitem id="mail_channel_menu_all" parent="mail_channel_menu_root" sequence="100" action="mail_channel_action_view"/>
|
||||
|
||||
<!-- settings !-->
|
||||
<menuitem id="mail_channel_menu_settings" parent="base.menu_email" sequence="90"
|
||||
name="Channels" action="mail_channel_action_view"
|
||||
groups="base.group_no_one"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -2,15 +2,11 @@
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
<menuitem
|
||||
id="mail.mail_feeds_main"
|
||||
name="Chat"
|
||||
icon="fa-envelope"
|
||||
groups="base.group_user"
|
||||
sequence="1"
|
||||
web_icon="mail,static/description/icon.png"/>
|
||||
<menuitem id="mail.mail_thread_menu_root" name="Chat"
|
||||
icon="fa-envelope" web_icon="mail,static/description/icon.png"
|
||||
groups="base.group_user" sequence="1"/>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_mail_inbox_feeds">
|
||||
<record id="mail_message_action_inbox" model="ir.actions.act_window">
|
||||
<field name="name">Inbox</field>
|
||||
<field name="res_model">mail.message</field>
|
||||
<field name="view_type">form</field>
|
||||
@@ -30,8 +26,8 @@
|
||||
]</field>
|
||||
</record>
|
||||
|
||||
<menuitem id="mail.mail_inbox" name="Inbox" action="action_mail_inbox_feeds"
|
||||
parent="mail.mail_feeds_main" groups="base.group_user" sequence="1"/>
|
||||
<menuitem id="mail.mail_inbox" name="Inbox" action="mail_message_action_inbox"
|
||||
parent="mail.mail_thread_menu_root" groups="base.group_user" sequence="1"/>
|
||||
|
||||
<record id="action_mail_redirect" model="ir.actions.server">
|
||||
<field name="name">Mail Redirection (Document / Inbox)</field>
|
||||
|
||||
@@ -20,6 +20,6 @@ class mail_thread(osv.AbstractModel):
|
||||
cur_user = self.pool.get('res.users').browse(cr, SUPERUSER_ID, uid, context=context)
|
||||
# if uid is a portal user -> action is different
|
||||
if any(group.is_portal for group in cur_user.groups_id):
|
||||
return 'portal.action_mail_inbox_feeds_portal'
|
||||
return 'portal.mail_message_action_inbox_portal'
|
||||
else:
|
||||
return super(mail_thread, self)._get_inbox_action_xml_id(cr, uid, context=context)
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
<menuitem name="Messaging" id="portal_messages" parent="portal_menu" sequence="10" groups="base.group_portal"/>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_mail_inbox_feeds_portal">
|
||||
<record model="ir.actions.act_window" id="mail_message_action_inbox_portal">
|
||||
<field name="name">Inbox</field>
|
||||
<field name="res_model">mail.message</field>
|
||||
<field name="view_type">form</field>
|
||||
@@ -33,7 +33,7 @@
|
||||
</record>
|
||||
|
||||
<menuitem name="Inbox" id="portal_inbox" parent="portal_messages"
|
||||
action="action_mail_inbox_feeds_portal" sequence="10" groups="base.group_portal"/>
|
||||
action="mail_message_action_inbox_portal" sequence="10" groups="base.group_portal"/>
|
||||
|
||||
<!--
|
||||
Create menu items that we'll leave empty for now - they'll be
|
||||
|
||||
@@ -86,7 +86,7 @@ class test_portal(TestMail):
|
||||
@mute_logger('openerp.addons.mail.models.mail_mail', 'openerp.models')
|
||||
def test_inbox_redirection_portal(self):
|
||||
group_pigs = self.group_pigs
|
||||
port_act_id = self.ref('portal.action_mail_inbox_feeds_portal')
|
||||
port_act_id = self.ref('portal.mail_message_action_inbox_portal')
|
||||
# Data: post a message on pigs
|
||||
msg = group_pigs.message_post(body='My body', partner_ids=[self.user_employee.partner_id.id, self.user_portal.partner_id.id], type='comment', subtype='mail.mt_comment')
|
||||
# Chell has no read access to pigs -> should redirect to Portal Inbox
|
||||
|
||||
@@ -1013,7 +1013,7 @@
|
||||
</div>
|
||||
<div class="col-md-4 col-xs-12 text-center o_planner_white_box">
|
||||
<div class="panel">
|
||||
<a t-att-href="prepare_backend_url('mail.action_mail_inbox_feeds')"><i class="fa-2x" data-icon=""></i><br/> Follow the day-to-day activites to be sure that everyone is using it</a>
|
||||
<a t-att-href="prepare_backend_url('mail.mail_message_action_inbox')"><i class="fa-2x" data-icon=""></i><br/> Follow the day-to-day activites to be sure that everyone is using it</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user