+
+
- No scheduled activity yet
+ No data to display
+
+ Try to add some activity on records, or make sure that
+ there is no active filter in the search bar.
-
+
diff --git a/addons/mail/static/tests/activity_tests.js b/addons/mail/static/tests/activity_tests.js
index 790b47a6889..8dfa518da5f 100644
--- a/addons/mail/static/tests/activity_tests.js
+++ b/addons/mail/static/tests/activity_tests.js
@@ -4,6 +4,8 @@ odoo.define('mail.activity_view_tests', function (require) {
var ActivityView = require('mail.ActivityView');
var testUtils = require('web.test_utils');
+var createActionManager = testUtils.createActionManager;
+
var createView = testUtils.createView;
var ACTIVITY_DATA = {
"grouped_activities":{
@@ -204,8 +206,8 @@ QUnit.test('activity view: no content rendering', function (assert) {
assert.strictEqual(activity.$('.o_view_nocontent').length, 1,
"should display the no content helper");
- assert.strictEqual(activity.$('.o_view_nocontent').text().trim(),
- "No scheduled activity yet",
+ assert.strictEqual(activity.$('.o_view_nocontent .o_view_nocontent_empty_folder').text().trim(),
+ "No data to display",
"should display the no content helper text");
activity.destroy();
@@ -263,10 +265,10 @@ QUnit.test('activity view: activity widget', function (assert) {
assert.step('activity_send_mail');
return $.when();
}
- if (args.method === 'action_done_schedule_next'){
- assert.deepEqual([[3]],args.args, "Should execute action_done_schedule_next on activity 3 only ");
+ if (args.method === 'action_feedback_schedule_next'){
+ assert.deepEqual([[3]],args.args, "Should execute action_feedback_schedule_next on activity 3 only ");
assert.equal(args.kwargs.feedback, "feedback2");
- assert.step('action_done_schedule_next');
+ assert.step('action_feedback_schedule_next');
return $.when({serverGeneratedAction: true});
}
if (args.method === 'get_activity_data') {
@@ -329,12 +331,48 @@ QUnit.test('activity view: activity widget', function (assert) {
"do_action_compose",
"activity_send_mail",
"do_action_activity",
- "action_done_schedule_next",
+ "action_feedback_schedule_next",
"serverGeneratedAction"
]);
activity.destroy();
+});
+QUnit.test('activity view: no group by', function (assert) {
+ assert.expect(4);
+
+ var actionManager = createActionManager({
+ actions: [{
+ id: 1,
+ name: 'Task Action',
+ res_model: 'task',
+ type: 'ir.actions.act_window',
+ views: [[false, 'activity']],
+ }],
+ archs: {
+ 'task,false,activity': '
',
+ 'task,false,search': '
',
+ },
+ data: this.data,
+ mockRPC: function(route, args) {
+ if (args.method === 'get_activity_data') {
+ return $.when(ACTIVITY_DATA);
+ }
+ return this._super(route, args);
+ },
});
+ actionManager.doAction(1);
+
+ assert.strictEqual($('.o_search_options .o_dropdown:visible').length, 2,
+ "only two elements should be available in view search");
+ assert.strictEqual($('.o_search_options .o_dropdown:visible .o_filters_menu').length, 1,
+ "filter should be available in view search");
+ assert.strictEqual($('.o_search_options .o_dropdown:visible .o_favorites_menu').length, 1,
+ "favorites should be available in view search");
+ assert.strictEqual($('.o_search_options .o_dropdown:hidden .o_group_by_menu').length, 1,
+ "group by should be hidden");
+ actionManager.destroy();
+});
+
});
});
diff --git a/addons/mail/static/tests/chatter_tests.js b/addons/mail/static/tests/chatter_tests.js
index 0e97449e935..6bfa25de433 100644
--- a/addons/mail/static/tests/chatter_tests.js
+++ b/addons/mail/static/tests/chatter_tests.js
@@ -447,7 +447,7 @@ QUnit.test('kanban activity widget popover test', function (assert) {
'' +
'',
mockRPC: function (route, args) {
- if (route === '/web/dataset/call_kw/mail.activity/action_done_schedule_next') {
+ if (route === '/web/dataset/call_kw/mail.activity/action_feedback_schedule_next') {
rpcCount++;
var current_ids = this.data.partner.records[0].activity_ids;
@@ -1224,8 +1224,8 @@ QUnit.test('form activity widget: schedule next activity', function (assert) {
'',
res_id: 2,
mockRPC: function (route, args) {
- if (route === '/web/dataset/call_kw/mail.activity/action_done_schedule_next') {
- assert.ok(_.isEqual(args.args[0], [1]), "should call 'action_done_schedule_next' for id 1");
+ if (route === '/web/dataset/call_kw/mail.activity/action_feedback_schedule_next') {
+ assert.ok(_.isEqual(args.args[0], [1]), "should call 'action_feedback_schedule_next' for id 1");
assert.strictEqual(args.kwargs.feedback, 'everything is ok',
"the feedback should be sent correctly");
return $.when('test_result');
@@ -1248,6 +1248,71 @@ QUnit.test('form activity widget: schedule next activity', function (assert) {
form.destroy();
});
+
+QUnit.test('form activity widget: edit next activity', function (assert) {
+ assert.expect(3);
+ var self = this;
+ this.data.partner.records[0].activity_ids = [1];
+ this.data.partner.records[0].activity_state = 'today';
+ this.data['mail.activity'].records = [{
+ id: 1,
+ display_name: "An activity",
+ date_deadline: moment().format("YYYY-MM-DD"), // now
+ state: "today",
+ user_id: 2,
+ create_user_id: 2,
+ activity_type_id: 2,
+ }];
+
+ var form = createView({
+ View: FormView,
+ model: 'partner',
+ data: this.data,
+ services: this.services,
+ arch: '
',
+ res_id: 2,
+ intercepts: {
+ do_action: function (event) {
+ assert.deepEqual(event.data.action, {
+ context: {
+ default_res_id: 2,
+ default_res_model: "partner"
+ },
+ res_id: 1,
+ res_model: "mail.activity",
+ target: "new",
+ type: "ir.actions.act_window",
+ view_mode: "form",
+ view_type: "form",
+ views: [
+ [
+ false,
+ "form"
+ ]
+ ]
+ },
+ "should do a do_action with correct parameters");
+ self.data['mail.activity'].records[0].activity_type_id = 1;
+ event.data.options.on_close();
+ },
+ },
+ });
+ assert.strictEqual(form.$('.o_mail_activity .o_mail_info strong:eq(1)').text(), " Type 2",
+ "Initial type should be Type 2");
+ form.$('.o_mail_activity .o_edit_activity[data-activity-id=1]').click();
+ assert.strictEqual(form.$('.o_mail_activity .o_mail_info strong:eq(1)').text(), " Type 1",
+ "After edit type should be Type 1");
+ form.destroy();
+});
+
QUnit.test('form activity widget: clic mail template', function (assert) {
assert.expect(4);
this.data.partner.records[0].activity_ids = [1];