mirror of https://github.com/OCA/social.git
[MIG] mail_activity_board: Migration to 17.0
parent
86119fada0
commit
b24e056551
|
@ -4,7 +4,7 @@
|
||||||
{
|
{
|
||||||
"name": "Mail Activity Board",
|
"name": "Mail Activity Board",
|
||||||
"summary": "Add Activity Boards",
|
"summary": "Add Activity Boards",
|
||||||
"version": "16.0.1.1.1",
|
"version": "17.0.1.0.0",
|
||||||
"development_status": "Beta",
|
"development_status": "Beta",
|
||||||
"category": "Social Network",
|
"category": "Social Network",
|
||||||
"website": "https://github.com/OCA/social",
|
"website": "https://github.com/OCA/social",
|
||||||
|
@ -15,8 +15,8 @@
|
||||||
"data": ["security/groups.xml", "views/mail_activity_view.xml"],
|
"data": ["security/groups.xml", "views/mail_activity_view.xml"],
|
||||||
"assets": {
|
"assets": {
|
||||||
"web.assets_backend": [
|
"web.assets_backend": [
|
||||||
"mail_activity_board/static/src/components/chatter_topbar/chatter_topbar.esm.js",
|
"mail_activity_board/static/src/components/chatter/chatter.esm.js",
|
||||||
"mail_activity_board/static/src/components/chatter_topbar/chatter_topbar.xml",
|
"mail_activity_board/static/src/components/chatter/chatter.xml",
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -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">
|
<!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">
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||||
<head>
|
<head>
|
||||||
|
|
|
@ -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();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
|
@ -1,20 +1,19 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<templates id="template" xml:space="preserve">
|
<templates id="template" xml:space="preserve">
|
||||||
<t
|
<t
|
||||||
t-name="ChatterTopbar"
|
t-name="mail_activity_board.Chatter"
|
||||||
t-inherit="mail.ChatterTopbar"
|
t-inherit="mail.Chatter"
|
||||||
t-inherit-mode="extension"
|
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
|
<button
|
||||||
class="btn btn-link o_ChatterTopbar_button"
|
class="btn btn-link o_ChatterTopbar_button"
|
||||||
type="button"
|
type="button"
|
||||||
t-att-disabled="!chatterTopbar.chatter.hasWriteAccess"
|
t-att-disabled="!state.thread.hasWriteAccess"
|
||||||
t-on-click="_onListActivity"
|
t-on-click="_onListActivity"
|
||||||
>
|
>
|
||||||
<i class="fa fa-list" /> View Activities
|
<i class="fa fa-list" /> View Activities
|
||||||
</button>
|
</button>
|
||||||
</t>
|
</xpath>
|
||||||
</t>
|
</t>
|
||||||
</templates>
|
</templates>
|
|
@ -1,45 +0,0 @@
|
||||||
/** @odoo-module **/
|
|
||||||
import {ChatterTopbar} from "@mail/components/chatter_topbar/chatter_topbar";
|
|
||||||
import {bus} from "web.core";
|
|
||||||
import {patch} from "@web/core/utils/patch";
|
|
||||||
const components = {ChatterTopbar};
|
|
||||||
// Import {rpc}
|
|
||||||
import rpc from "web.rpc";
|
|
||||||
|
|
||||||
patch(
|
|
||||||
components.ChatterTopbar.prototype,
|
|
||||||
"mail_activity_board/static/src/components/chatter_topbar/chatter_topbar.esm.js",
|
|
||||||
{
|
|
||||||
// --------------------------------------------------------------------------
|
|
||||||
// Handlers
|
|
||||||
// --------------------------------------------------------------------------
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @private
|
|
||||||
* @param {MouseEvent} ev
|
|
||||||
*/
|
|
||||||
// eslint-disable-next-line no-unused-vars
|
|
||||||
async _onListActivity(ev) {
|
|
||||||
rpc.query({
|
|
||||||
model: this.chatterTopbar.chatter.thread.model,
|
|
||||||
method: "redirect_to_activities",
|
|
||||||
args: [[]],
|
|
||||||
kwargs: {
|
|
||||||
id: this.chatterTopbar.chatter.thread.id,
|
|
||||||
model: this.chatterTopbar.chatter.thread.model,
|
|
||||||
},
|
|
||||||
context: {},
|
|
||||||
}).then(function (action) {
|
|
||||||
bus.trigger("do-action", {
|
|
||||||
action,
|
|
||||||
options: {
|
|
||||||
on_close: () => {
|
|
||||||
this.chatterTopbar.chatter.thread.refreshActivities();
|
|
||||||
this.chatterTopbar.chatter.thread.refresh();
|
|
||||||
},
|
|
||||||
},
|
|
||||||
});
|
|
||||||
});
|
|
||||||
},
|
|
||||||
}
|
|
||||||
);
|
|
|
@ -5,7 +5,7 @@ from odoo.tests.common import TransactionCase
|
||||||
|
|
||||||
class TestMailActivityBoardMethods(TransactionCase):
|
class TestMailActivityBoardMethods(TransactionCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(TestMailActivityBoardMethods, self).setUp()
|
super().setUp()
|
||||||
# Set up activities
|
# Set up activities
|
||||||
|
|
||||||
# Create a user as 'Crm Salesman' and added few groups
|
# Create a user as 'Crm Salesman' and added few groups
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
<field name="activity_type_id" position="before">
|
<field name="activity_type_id" position="before">
|
||||||
<field
|
<field
|
||||||
name="related_model_instance"
|
name="related_model_instance"
|
||||||
attrs="{'invisible': [('related_model_instance','=', False)]}"
|
invisible="not related_model_instance"
|
||||||
/>
|
/>
|
||||||
</field>
|
</field>
|
||||||
</field>
|
</field>
|
||||||
|
@ -78,25 +78,24 @@
|
||||||
<group>
|
<group>
|
||||||
<field
|
<field
|
||||||
name="date_deadline"
|
name="date_deadline"
|
||||||
attrs="{'invisible': [('activity_category', '=', 'meeting')]}"
|
invisible="activity_category == 'meeting'"
|
||||||
/>
|
/>
|
||||||
<field
|
<field
|
||||||
name="calendar_event_id_start"
|
name="calendar_event_id_start"
|
||||||
string="Start meeting"
|
string="Start meeting"
|
||||||
attrs="{'invisible': [('calendar_event_id','=', False)]}"
|
invisible="not calendar_event_id"
|
||||||
/>
|
/>
|
||||||
<field
|
<field
|
||||||
name="duration"
|
name="duration"
|
||||||
widget="float_time"
|
widget="float_time"
|
||||||
attrs="{'invisible': ['|',('duration', '=', False),
|
invisible="not duration or not calendar_event_id"
|
||||||
('calendar_event_id','=', False)]}"
|
|
||||||
/>
|
/>
|
||||||
<field name="user_id" options="{'no_open': True}" />
|
<field name="user_id" options="{'no_open': True}" />
|
||||||
|
|
||||||
</group>
|
</group>
|
||||||
</group>
|
</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" />
|
<field name="calendar_event_id_partner_ids" mode="kanban" />
|
||||||
</group>
|
</group>
|
||||||
|
|
Loading…
Reference in New Issue