-
-
Notifications
You must be signed in to change notification settings - Fork 623
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[11.0][mail_activity_board] Add new module that insert activities board in boards. #283
Changes from 4 commits
d56c2f0
4b929c4
7ed0a4c
919f33e
cc486cb
4caf09e
ad7b784
f870bad
ce43235
82dd15e
470b3dc
4456f9e
e93ca79
676a3ed
0146f61
926cc1f
d642084
21b8b8a
28c6295
0bdcc94
bbb99e7
3ddadf7
97297af
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,72 +1,21 @@ | ||
**This file is going to be generated by oca-gen-addon-readme.** | ||
|
||
*Manual changes will be overwritten.* | ||
|
||
Please provide content in the ``readme`` directory: | ||
|
||
* **DESCRIPTION.rst** (required) | ||
* INSTALL.rst (optional) | ||
* CONFIGURE.rst (optional) | ||
* **USAGE.rst** (optional, highly recommended) | ||
* DEVELOP.rst (optional) | ||
* ROADMAP.rst (optional) | ||
* HISTORY.rst (optional, recommended) | ||
* **CONTRIBUTORS.rst** (optional, highly recommended) | ||
* CREDITS.rst (optional) | ||
|
||
Content of this README will also be drawn from the addon manifest, | ||
from keys such as name, authors, maintainers, development_status, | ||
and license. | ||
|
||
.. image:: https://img.shields.io/badge/license-AGPL--3-blue.png | ||
:target: https://www.gnu.org/licenses/agpl | ||
:alt: License: AGPL-3 | ||
|
||
|
||
|
||
================ | ||
Activities Board | ||
================ | ||
|
||
This module adds an activity board with form, tree, kanban, calendar, pivot, graph and search views. | ||
|
||
|
||
Configuration | ||
============= | ||
|
||
|
||
Install it from APPs. | ||
|
||
|
||
Usage | ||
===== | ||
|
||
Access to the views from menu Boards. | ||
|
||
A smartButton of activities is added in the opportunity form view. | ||
From this smartButton is linked to the activity board, to the view tree, | ||
which shows the activities related to the opportunity. | ||
|
||
From the form view of the activity you can navigate to the origin of the activity. | ||
|
||
|
||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/social/issues>`_. | ||
In case of trouble, please check there if your issue has already been reported. | ||
|
||
|
||
Credits | ||
======= | ||
|
||
|
||
Contributors | ||
------------ | ||
|
||
* SDI <http://www.sdi.es> | ||
|
||
* David Juaneda Ayensa <djuaneda@sdi.es> | ||
* Javier Garcia <jgarcia@sdi.es> | ||
|
||
|
||
Maintainer | ||
---------- | ||
|
||
.. image:: https://odoo-community.org/logo.png | ||
:alt: Odoo Community Association | ||
:target: https://odoo-community.org | ||
|
||
This module is maintained by the OCA. | ||
|
||
OCA, or the Odoo Community Association, is a nonprofit organization whose | ||
mission is to support the collaborative development of Odoo features and | ||
promote its widespread use. | ||
|
||
To contribute to this module, please visit http://odoo-community.org. | ||
A good, one sentence summary in the manifest is also highly recommended. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1 @@ | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
# SDI | ||
# author: djuaneda@sdi.es | ||
|
||
from . import models |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
# Copyright 2018 SDi - David Juaneda | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) | ||
# Copyright 2016 David Juaneda - <djuaneda@sdi.es> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
{ | ||
'name': 'Activities board', | ||
'version': '11.0.1.0.1', | ||
'category': 'Social Network', | ||
'author': 'David Juaneda, ' | ||
'Javier Garcia, ' | ||
'Odoo Community Association (OCA)', | ||
'website': 'https://github.com/OCA/social', | ||
'summary': 'Add Activity Boards', | ||
'license': 'GPL-3', | ||
'version': '11.0.1.0.0', | ||
'development_status': 'Beta', | ||
'category': 'Uncategorized', | ||
'website': 'https://github.com/OCA/social', | ||
'author': 'SDi, David Juaneda, Odoo Community Association (OCA)', | ||
'license': 'AGPL-3', | ||
'application': False, | ||
'installable': True, | ||
'depends': [ | ||
'crm', | ||
'mail', | ||
'calendar', | ||
'board', | ||
], | ||
'data': [ | ||
'views/templates.xml', | ||
'views/mail_activity_view.xml', | ||
'views/crm_lead_opportunity_view.xml', | ||
], | ||
'qweb': [], | ||
'demo': [], | ||
'installable': True, | ||
'qweb': [ | ||
'static/src/xml/inherit_chatter.xml', | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,2 @@ | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
# SDI | ||
# author: djuaneda@sdi.es | ||
|
||
from . import crm_lead | ||
from . import mail_activity | ||
from . import mail_activity_mixin |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,27 @@ | ||
# Copyright 2016 David Juaneda - <djuaneda@sdi.es> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
# SDI | ||
# author: djuaneda@sdi.es | ||
from odoo import api, models, fields | ||
from odoo.tools.safe_eval import safe_eval | ||
|
||
|
||
class MailActivity(models.Model): | ||
_inherit = "mail.activity" | ||
|
||
res_model_id_name = fields.Char( | ||
default="", related='res_model_id.name', | ||
string="Origin", store=False, readonly=True) | ||
related='res_model_id.name', string="Origin", | ||
store=False, default="", readonly=True) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Also, There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Deleted store=False. |
||
duration = fields.Float( | ||
related='calendar_event_id.duration', | ||
string="Duration", store=False, readonly=True) | ||
calendar_event_id_start = fields.Datetime( | ||
default=False, related='calendar_event_id.start', | ||
related='calendar_event_id.duration', string="Duration", | ||
store=False, readonly=True) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Most likely, with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have tried to leave the field with only "related" and "readonly" attributes and it has behaved as you have indicated, so I have changed it. |
||
calendar_event_id_start = fields.Datetime( | ||
related='calendar_event_id.start', string="Start", | ||
store=False, default=False, readonly=True) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Me too. |
||
calendar_event_id_partner_ids = fields.Many2many( | ||
related='calendar_event_id.partner_ids', string='Attendees', | ||
store=False, default=False, readonly=True) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Me too. |
||
|
||
@api.multi | ||
def open_origin(self): | ||
""" | ||
Utility method used to add an "Open Company" button in partner views. | ||
""" | ||
""" """ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔥 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes!!! |
||
self.ensure_one() | ||
response = {'type': 'ir.actions.act_window', | ||
'res_model': self.res_model, | ||
|
@@ -41,9 +37,7 @@ def open_origin(self): | |
return response | ||
|
||
@api.model | ||
def action_your_activities(self): | ||
def action_activities_board(self): | ||
action = self.env.ref( | ||
'mail_activity_board.open_boards_activities_form_tree').read()[0] | ||
action_context = safe_eval(action['context'], {'uid': self.env.uid}) | ||
action['context'] = action_context | ||
'mail_activity_board.open_boards_activities').read()[0] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. just do There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. They do not return the same. I can not change it |
||
return action |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Copyright 2016 David Juaneda - <djuaneda@sdi.es> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
from odoo import models | ||
|
||
|
||
class MailActivityMixin(models.AbstractModel): | ||
_inherit = 'mail.activity.mixin' | ||
|
||
def redirect_to_activities(self, **kwargs): | ||
""" | ||
Redirects to the list of activities of the object shown. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Put this line along with the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Corrected it. |
||
|
||
Redirects to the activity board and configures the domain so that | ||
only those activities that are related to the object shown are | ||
displayed. | ||
|
||
Add to the title of the view the name the class of the object from | ||
which the activities will be displayed. | ||
|
||
:param kwargs: Dictionary that contains the id of the object | ||
and the model it is about. | ||
:return: action. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reduce 4 spaces of indentation in all this docstring. FTR https://www.python.org/dev/peps/pep-0257/#multi-line-docstrings There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the link. |
||
""" | ||
id = kwargs.get("id") | ||
action = self.env['mail.activity'].action_activities_board() | ||
views = [] | ||
for v in action['views']: | ||
if v[1] == 'tree': | ||
v = (v[0], 'list') | ||
views.append(v) | ||
action['views'] = views | ||
action['domain'] = [('res_id', '=', id)] | ||
return action |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
* `SDI <https://www.sdi.es>`_: | ||
|
||
* David Juaneda |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
This module adds an activity board with form, tree, kanban, calendar, pivot, graph and search views. | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔥 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
11.0.0.0.0 (2018-06-12) | ||
~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
* [BREAKING] Breaking changes come first. | ||
(`#70 <https://github.com/OCA/repo/issues/70>`_) | ||
* [ADD] New feature. | ||
(`#74 <https://github.com/OCA/repo/issues/74>`_) | ||
* [FIX] Correct this. | ||
(`#71 <https://github.com/OCA/repo/issues/71>`_) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔥 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I delete this file. |
||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
To use this module, you need to: | ||
|
||
#. Access to the views from menu Boards. | ||
|
||
A smartButton of activities is added in the mail thread from form view. | ||
From this smartButton is linked to the activity board, to the view tree, | ||
which shows the activities related to the opportunity. | ||
|
||
From the form view of the activity you can navigate to the origin of the activity. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* Copyright 2018 David Juaneda | ||
* License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). */ | ||
|
||
odoo.define('mail.Chatter.activity', function(require){ | ||
"use strict"; | ||
|
||
var chatter = require('mail.Chatter'); | ||
|
||
chatter.include({ | ||
|
||
events: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I hope you're not overriding parent events. To protect against that, you should do: events: _.extend({}, chatter.prototype.events, {
// your events here...
}), JS is funny 😋 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When you know what little you've learned by hitting your head against the wall, ... it's very funny, it's not just. |
||
'click .o_chatter_button_new_message': '_onOpenComposerMessage', | ||
'click .o_chatter_button_log_note': '_onOpenComposerNote', | ||
'click .o_chatter_button_schedule_activity': '_onScheduleActivity', | ||
'click .o_chatter_button_count_activity': '_onCountActivity', | ||
}, | ||
|
||
_onCountActivity: function (event) { | ||
event.preventDefault(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not needed if you add There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You mean only the line:
|
||
var self = this; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You can remove this... |
||
this._rpc({ | ||
model: self.record.model, | ||
method: 'redirect_to_activities', | ||
args: [[]], | ||
kwargs: {'id':self.record.res_id, | ||
'model':self.record.model}, | ||
context: this.record.getContext(), | ||
}).then(function(action) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ... if you do this here: }).then($.proxy(this, "do_action")); There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I take note, although I do not know very well what it does |
||
return self.do_action(action); | ||
}); | ||
}, | ||
|
||
}); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<templates xml:space="preserve"> | ||
|
||
<t t-extend="mail.Chatter.Buttons"> | ||
<t t-jquery="button.o_chatter_button_schedule_activity" t-operation="after"> | ||
<button t-if="schedule_activity_btn" class="btn btn-sm btn-link o_chatter_button_count_activity" title=" activity"> | ||
<i class="fa fa-list"/> <t t-if="isMobile">Activities</t><t t-else="">Activities</t> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why the if? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. copy & paste There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I already removed it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Finally I have left it: because it shows a different legend if 'isMobile' or not. |
||
</button> | ||
</t> | ||
</t> | ||
|
||
</templates> |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Social Network was a good category IMHO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed it.