diff --git a/activity_dashboard_mngmnt/README.rst b/activity_dashboard_mngmnt/README.rst index 37f5988e2..bcad5c979 100644 --- a/activity_dashboard_mngmnt/README.rst +++ b/activity_dashboard_mngmnt/README.rst @@ -1,6 +1,14 @@ -Activity Management v16 -====================== +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + Activity Management +====================== +Activity Management v16.0. Manage activity from dashboard. + +Company +------- +* `Cybrosys Techno Solutions `__ Installation ============ @@ -16,3 +24,29 @@ Credits ======= Developer: Megha v15 @ cybrosys, Contact: odoo@cybrosys.com Amaya Aravind EV v16 @ cybrosys, Contact: odoo@cybrosys.com +License +------- +General Public License, Version 3 (AGPL v3). +(https://www.odoo.com/documentation/user/16.0/legal/licenses/licenses.html) + +Contacts +-------- +* Mail Contact : odoo@cybrosys.com +* Website : https://cybrosys.com + +Bug Tracker +----------- +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Maintainer +========== +.. image:: https://cybrosys.com/images/logo.png + :target: https://cybrosys.com + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit `Our Website `__ + +Further information +=================== +HTML Description: ``__ diff --git a/activity_dashboard_mngmnt/__init__.py b/activity_dashboard_mngmnt/__init__.py index 7d16d55b6..677d4418f 100644 --- a/activity_dashboard_mngmnt/__init__.py +++ b/activity_dashboard_mngmnt/__init__.py @@ -4,7 +4,7 @@ # # Cybrosys Technologies Pvt. Ltd. # Copyright (C) 2022-TODAY Cybrosys Technologies (). -# Author: Megha K () +# Author: Cybrosys Technologies () # # This program is free software: you can modify # it under the terms of the GNU Affero General Public License (AGPL) as @@ -20,5 +20,4 @@ # along with this program. If not, see . # ################################################################################### - from . import models diff --git a/activity_dashboard_mngmnt/__manifest__.py b/activity_dashboard_mngmnt/__manifest__.py index 65f2932a3..f4131d2a4 100644 --- a/activity_dashboard_mngmnt/__manifest__.py +++ b/activity_dashboard_mngmnt/__manifest__.py @@ -4,7 +4,7 @@ # # Cybrosys Technologies Pvt. Ltd. # Copyright (C) 2022-TODAY Cybrosys Technologies (). -# Author: Megha K () +# Author: Cybrosys Technologies () # # This program is free software: you can modify # it under the terms of the GNU Affero General Public License (AGPL) as @@ -20,23 +20,23 @@ # along with this program. If not, see . # ################################################################################### - { 'name': 'Activity Management', - 'version': '16.0.1.0.0', + 'version': '16.0.1.1.0', 'category': 'Tools', - 'summary': 'Advance Activity Management and Dashboard View', + 'summary': 'Advance Activity Management and Dashboard View.', 'author': 'Cybrosys Techno Solutions', 'maintainer': 'Cybrosys Techno Solutions', 'company': 'Cybrosys Techno Solutions', 'website': 'https://www.cybrosys.com', - 'description': "Advance Activity Management and Dashboard View", + 'description': "Advance Activity Management and Dashboard View to track " + "activity of users.", 'depends': ['base', 'mail'], 'images': ['static/description/banner.png'], 'data': [ 'security/ir.model.access.csv', - 'views/my_activity.xml', - 'views/activity_tag.xml', + 'views/mail_activity_views.xml', + 'views/activity_tag_views.xml', 'views/activity_dashbord.xml' ], 'assets': { @@ -49,7 +49,7 @@ ], }, 'installable': True, - 'application': False, + 'application': True, 'auto_install': False, 'license': 'AGPL-3', } diff --git a/activity_dashboard_mngmnt/doc/RELEASE_NOTES.md b/activity_dashboard_mngmnt/doc/RELEASE_NOTES.md index c1e80861f..99747d014 100644 --- a/activity_dashboard_mngmnt/doc/RELEASE_NOTES.md +++ b/activity_dashboard_mngmnt/doc/RELEASE_NOTES.md @@ -3,4 +3,14 @@ #### 16.12.2022 #### Version 16.0.1.0.0 ##### ADD -- Initial commit for activity_dashboard_mngmnt \ No newline at end of file + +- Initial commit for Activity Management + +#### 10.08.2022 +#### Version 16.0.1.1.0 +##### UPDT + +- Bug fix. +- User can see their own activity. +- Admin can see all activity. +- Performance updates. diff --git a/activity_dashboard_mngmnt/models/__init__.py b/activity_dashboard_mngmnt/models/__init__.py index 93a2c2803..4828dcbda 100644 --- a/activity_dashboard_mngmnt/models/__init__.py +++ b/activity_dashboard_mngmnt/models/__init__.py @@ -1,10 +1,10 @@ # -*- coding: utf-8 -*- ################################################################################### -# Freight Management +# Activity Management # # Cybrosys Technologies Pvt. Ltd. # Copyright (C) 2022-TODAY Cybrosys Technologies (). -# Author: Megha K () +# Author: Cybrosys Technologies () # # This program is free software: you can modify # it under the terms of the GNU Affero General Public License (AGPL) as @@ -20,6 +20,5 @@ # along with this program. If not, see . # ################################################################################### - +from . import activity_tag from . import mail_activity -from . import activity_type diff --git a/activity_dashboard_mngmnt/models/activity_type.py b/activity_dashboard_mngmnt/models/activity_tag.py similarity index 72% rename from activity_dashboard_mngmnt/models/activity_type.py rename to activity_dashboard_mngmnt/models/activity_tag.py index 04fe2fffe..8b24c5413 100644 --- a/activity_dashboard_mngmnt/models/activity_type.py +++ b/activity_dashboard_mngmnt/models/activity_tag.py @@ -4,7 +4,7 @@ # # Cybrosys Technologies Pvt. Ltd. # Copyright (C) 2022-TODAY Cybrosys Technologies (). -# Author: Megha K () +# Author: Cybrosys Technologies () # # This program is free software: you can modify # it under the terms of the GNU Affero General Public License (AGPL) as @@ -20,21 +20,26 @@ # along with this program. If not, see . # ################################################################################### - from random import randint from odoo import fields, models class ActivityTag(models.Model): + """Model to add tags to an activity""" _name = "activity.tag" _description = "Activity Tag" def _get_default_color(self): + """:returns random intrger between 1 and 11""" return randint(1, 11) - name = fields.Char('Tag Name', required=True, translate=True) - color = fields.Integer('Color', default=_get_default_color) + name = fields.Char(string='Tag Name', + help='Name of the activity tag.', + required=True, + translate=True) + color = fields.Integer(string='Color', + help='Field that gives color to tag.', + default=_get_default_color) _sql_constraints = [ - ('name_uniq', 'unique (name)', "Tag name already exists !"), - ] + ('name_uniq', 'unique (name)', "Tag name already exists !"), ] diff --git a/activity_dashboard_mngmnt/models/mail_activity.py b/activity_dashboard_mngmnt/models/mail_activity.py index bee010c04..fb610bc1e 100644 --- a/activity_dashboard_mngmnt/models/mail_activity.py +++ b/activity_dashboard_mngmnt/models/mail_activity.py @@ -4,7 +4,7 @@ # # Cybrosys Technologies Pvt. Ltd. # Copyright (C) 2022-TODAY Cybrosys Technologies (). -# Author: Megha K () +# Author: Cybrosys Technologies () # # This program is free software: you can modify # it under the terms of the GNU Affero General Public License (AGPL) as @@ -20,7 +20,6 @@ # along with this program. If not, see . # ################################################################################### - from datetime import date, datetime from collections import defaultdict import pytz @@ -30,25 +29,32 @@ from odoo.exceptions import UserError class MailActivity(models.Model): + """Inherited mail.activity model + mostly to add dashboard functionalities""" _inherit = "mail.activity" state = fields.Selection([ ('overdue', 'Overdue'), ('today', 'Today'), ('planned', 'Planned'), - ('done', 'Done'), ('cancel', 'Cancelled')], 'State', + ('done', 'Done'), ('cancel', 'Cancelled')], string='State', + help='Track state of activity.', compute='_compute_state', store=True) - active = fields.Boolean('Active', default=True) - + active = fields.Boolean(string='Active', + help='Default field to archive', + default=True) type = fields.Selection( [('overdue', 'Overdue'), ('today', 'Today'), ('planned', 'Planned'), - ('done', 'Done'), ('cancel', 'Cancelled')]) - activity_type = fields.Many2many('activity.tag') + ('done', 'Done'), ('cancel', 'Cancelled')], + string='Type', help='Choose the type of activity.') + + activity_tag_ids = fields.Many2many('activity.tag', string='Activity Tags', + help='Select activity tags.') def activity_cancel(self): """cancel activity""" for rec in self: if rec.state == 'cancel': raise UserError( - _("You Cant Cancelled this activity %s") % rec.res_name) + _("You Cant Cancel this activity %s") % rec.res_name) else: rec.action_cancel() @@ -57,20 +63,25 @@ class MailActivity(models.Model): for rec in self: if rec.state == 'done': raise UserError( - _("You Cant Cancelled this activity %s") % rec.res_name) + _("You Cant Cancel this activity %s") % rec.res_name) else: rec._action_done() def get_activity_count(self): """get the activity count details""" activity = self.env['mail.activity'] - all = activity.search([]) - planned = activity.search([('state', '=', 'planned')]) - overdue = activity.search([('state', '=', 'overdue')]) - today = activity.search([('state', '=', 'today')]) - done = activity.search([('state', '=', 'done'), ('active', '=', False)]) - cancel = activity.search([('state', '=', 'cancel')]) - return { + domain = [] + if self.env.user._is_admin(): + domain = domain + else: + domain.append(('user_id', '=', self.env.user.id), ) + all = activity.with_context(active_test=False).search(domain) + planned = all.filtered(lambda x: x.state == 'planned') + overdue = all.filtered(lambda x: x.state == 'overdue') + today = all.filtered(lambda x: x.state == 'today') + done = all.filtered(lambda x: x.state == 'done') + cancel = all.filtered(lambda x: x.state == 'cancel') + res = { 'len_all': len(all), 'len_overdue': len(overdue), 'len_planned': len(planned), @@ -78,9 +89,11 @@ class MailActivity(models.Model): 'len_done': len(done), 'len_cancel': len(cancel) } + print('res', res) + return res def get_activity(self, id): - activity = self.env['mail.activity'].search([('id', '=', id)]) + activity = self.env['mail.activity'].browse(id) return { 'model': activity.res_model, 'res_id': activity.res_id @@ -139,7 +152,6 @@ class MailActivity(models.Model): for rec in self: rec.state = 'done' rec.active = False - return messages, next_activities @api.model diff --git a/activity_dashboard_mngmnt/static/description/assets/modules/barcode.png b/activity_dashboard_mngmnt/static/description/assets/modules/barcode.png new file mode 100644 index 000000000..f14dc60c5 Binary files /dev/null and b/activity_dashboard_mngmnt/static/description/assets/modules/barcode.png differ diff --git a/activity_dashboard_mngmnt/static/description/assets/modules/dashboard.png b/activity_dashboard_mngmnt/static/description/assets/modules/dashboard.png new file mode 100644 index 000000000..17c14989e Binary files /dev/null and b/activity_dashboard_mngmnt/static/description/assets/modules/dashboard.png differ diff --git a/activity_dashboard_mngmnt/static/description/assets/modules/product_creation.png b/activity_dashboard_mngmnt/static/description/assets/modules/product_creation.png new file mode 100644 index 000000000..fd1f87699 Binary files /dev/null and b/activity_dashboard_mngmnt/static/description/assets/modules/product_creation.png differ diff --git a/activity_dashboard_mngmnt/static/description/assets/modules/receipt.png b/activity_dashboard_mngmnt/static/description/assets/modules/receipt.png new file mode 100644 index 000000000..d1d3775d6 Binary files /dev/null and b/activity_dashboard_mngmnt/static/description/assets/modules/receipt.png differ diff --git a/activity_dashboard_mngmnt/static/description/assets/modules/service.png b/activity_dashboard_mngmnt/static/description/assets/modules/service.png new file mode 100644 index 000000000..c247ba6ac Binary files /dev/null and b/activity_dashboard_mngmnt/static/description/assets/modules/service.png differ diff --git a/activity_dashboard_mngmnt/static/description/assets/modules/time_based.png b/activity_dashboard_mngmnt/static/description/assets/modules/time_based.png new file mode 100644 index 000000000..4e7befe1f Binary files /dev/null and b/activity_dashboard_mngmnt/static/description/assets/modules/time_based.png differ diff --git a/activity_dashboard_mngmnt/static/description/index.html b/activity_dashboard_mngmnt/static/description/index.html index 11b2a03c8..415a685cb 100644 --- a/activity_dashboard_mngmnt/static/description/index.html +++ b/activity_dashboard_mngmnt/static/description/index.html @@ -242,46 +242,47 @@