Skip to content

Commit

Permalink
[MIG] mail_activity_board: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lef-adhoc committed Feb 5, 2024
1 parent e727930 commit ae7e7a7
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 62 deletions.
6 changes: 3 additions & 3 deletions mail_activity_board/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
"name": "Mail Activity Board",
"summary": "Add Activity Boards",
"version": "16.0.1.1.1",
"version": "17.0.1.0.0",
"development_status": "Beta",
"category": "Social Network",
"website": "https://github.com/OCA/social",
Expand All @@ -15,8 +15,8 @@
"data": ["security/groups.xml", "views/mail_activity_view.xml"],
"assets": {
"web.assets_backend": [
"mail_activity_board/static/src/components/chatter_topbar/chatter_topbar.esm.js",
"mail_activity_board/static/src/components/chatter_topbar/chatter_topbar.xml",
"mail_activity_board/static/src/components/chatter/chatter.esm.js",
"mail_activity_board/static/src/components/chatter/chatter.xml",
],
},
}
1 change: 0 additions & 1 deletion mail_activity_board/static/description/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
Expand Down
35 changes: 35 additions & 0 deletions mail_activity_board/static/src/components/chatter/chatter.esm.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/** @odoo-module **/
import {Chatter} from "@mail/core/web/chatter";
import {patch} from "@web/core/utils/patch";

patch(Chatter.prototype, {
// --------------------------------------------------------------------------
// Handlers
// --------------------------------------------------------------------------

/**
* @private
* @param {MouseEvent} ev
*/
// eslint-disable-next-line no-unused-vars
async _onListActivity(ev) {
if (this.state.thread) {
const thread = this.state.thread;
const action = await this.orm.call(
thread.model,
"redirect_to_activities",
[[]],
{
id: this.state.thread.id,
model: this.state.thread.model,
}
);
this.action.doAction(action, {
onClose: () => {
thread.refreshActivities();
thread.refresh();
},
});
}
},
});
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
<?xml version="1.0" encoding="UTF-8" ?>
<templates id="template" xml:space="preserve">
<t
t-name="ChatterTopbar"
t-inherit="mail.ChatterTopbar"
t-name="mail_activity_board.Chatter"
t-inherit="mail.Chatter"
t-inherit-mode="extension"
owl="1"
>
<t t-if="chatterTopbar.chatter.hasActivities" position="after">
<xpath expr="//button[hasclass('o-mail-Chatter-activity')]" position="after">
<button
class="btn btn-link o_ChatterTopbar_button"
type="button"
t-att-disabled="!chatterTopbar.chatter.hasWriteAccess"
t-att-disabled="!state.thread.hasWriteAccess"
t-on-click="_onListActivity"
>
<i class="fa fa-list" /> View Activities
</button>
</t>
</xpath>
</t>
</templates>

This file was deleted.

2 changes: 1 addition & 1 deletion mail_activity_board/tests/test_mail_activity_board.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

class TestMailActivityBoardMethods(TransactionCase):
def setUp(self):
super(TestMailActivityBoardMethods, self).setUp()
super().setUp()
# Set up activities

# Create a user as 'Crm Salesman' and added few groups
Expand Down
11 changes: 5 additions & 6 deletions mail_activity_board/views/mail_activity_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<field name="activity_type_id" position="before">
<field
name="related_model_instance"
attrs="{'invisible': [('related_model_instance','=', False)]}"
invisible="not related_model_instance"
/>
</field>
</field>
Expand Down Expand Up @@ -78,25 +78,24 @@
<group>
<field
name="date_deadline"
attrs="{'invisible': [('activity_category', '=', 'meeting')]}"
invisible="activity_category == 'meeting'"
/>
<field
name="calendar_event_id_start"
string="Start meeting"
attrs="{'invisible': [('calendar_event_id','=', False)]}"
invisible="not calendar_event_id"
/>
<field
name="duration"
widget="float_time"
attrs="{'invisible': ['|',('duration', '=', False),
('calendar_event_id','=', False)]}"
invisible="not duration or not calendar_event_id"
/>
<field name="user_id" options="{'no_open': True}" />

</group>
</group>
<group
attrs="{'invisible': ['|',('calendar_event_id','=', False),('calendar_event_id_partner_ids','=', False)]}"
invisible="not calendar_event_id or not calendar_event_id_partner_ids"
>
<field name="calendar_event_id_partner_ids" mode="kanban" />
</group>
Expand Down

0 comments on commit ae7e7a7

Please sign in to comment.