diff --git a/personal_organiser/README.rst b/personal_organiser/README.rst new file mode 100644 index 000000000..f707a486b --- /dev/null +++ b/personal_organiser/README.rst @@ -0,0 +1,54 @@ +.. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg + :target: https://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +Personal Organiser +======================== +This module will help users to efficiently manage their notes, tasks, and events. + +Features +======== +* Note maker to take notes. +* Contact book for a quick reference. +* Task creator to manage activities. +* Calendar for a quick reference of tasks. + +Configuration +============= +Nothing to configure. + +License +------- +General Public License, Version 3 (AGPL v3). +(https://www.gnu.org/licenses/agpl-3.0-standalone.html) + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +* Developer (V17) Athira K, + Contact: odoo@cybrosys.com + +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/personal_organiser/__init__.py b/personal_organiser/__init__.py new file mode 100644 index 000000000..a4046ab82 --- /dev/null +++ b/personal_organiser/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author:Athira K() +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import models diff --git a/personal_organiser/__manifest__.py b/personal_organiser/__manifest__.py new file mode 100644 index 000000000..1c7922554 --- /dev/null +++ b/personal_organiser/__manifest__.py @@ -0,0 +1,107 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author:Athira K() +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +{ + 'name': 'Personal Organiser', + 'version': '17.0.1.0.0', + 'category': 'Tools', + 'summary': """The module allows to manage notes,tasks,and contacts effectively.""", + 'description': """This module allows you to manage notes, tasks, and contacts effectively from all views in odoo. """, + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'depends': ['base', 'web', 'calendar'], + 'data': ['security/ir.model.access.csv', + ], + + 'assets': { + 'web._assets_primary_variables': [ + 'personal_organiser/static/src/scss/variables.scss', + ], + 'web._assets_backend_helpers': [ + 'personal_organiser/static/src/scss/mixins.scss', + ], + 'web.assets_web_dark': [ + ( + 'after', + 'personal_organiser/static/src/scss/variables.scss', + 'personal_organiser/static/src/scss/variables.dark.scss', + ), + ], + 'web.assets_backend': [ + ( + 'after', + 'web/static/src/webclient/webclient.js', + 'personal_organiser/static/src/webclient/layout.js', + ), + ( + 'after', + 'web/static/src/webclient/webclient.xml', + 'personal_organiser/static/src/webclient/layout.xml', + ), + ( + 'after', + 'web/static/src/webclient/webclient.js', + 'personal_organiser/static/src/webclient/personalorganiser/personal_organiser.js', + ), + ( + 'after', + 'web/static/src/webclient/webclient.js', + 'personal_organiser/static/src/webclient/notemaker/notemaker.js', + ), + ( + 'after', + 'web/static/src/webclient/webclient.js', + 'personal_organiser/static/src/webclient/contacts/contacts.js', + ), + ( + 'after', + 'web/static/src/webclient/webclient.js', + 'personal_organiser/static/src/webclient/calender/calender.js', + ), + ( + 'after', + 'web/static/src/webclient/webclient.js', + 'personal_organiser/static/src/webclient/sidebar/sidebar.js', + ), + 'personal_organiser/static/src/webclient/layout.scss', + 'personal_organiser/static/src/webclient/sidebar/sidebar.scss', + 'personal_organiser/static/src/webclient/personalorganiser/personal_organiser.xml', + 'personal_organiser/static/src/webclient/notemaker/notemaker.xml', + 'personal_organiser/static/src/webclient/contacts/contacts.xml', + 'personal_organiser/static/src/webclient/calender/calender.xml', + 'personal_organiser/static/src/webclient/sidebar/sidebar.xml', + 'personal_organiser/static/src/webclient/personalorganiser/organizer.scss', + 'personal_organiser/static/src/webclient/notemaker/notemaker.scss', + 'personal_organiser/static/src/webclient/contacts/contacts.scss', + 'personal_organiser/static/src/webclient/calender/calender.scss', + ], + }, + 'license': 'AGPL-3', + 'images': [ + 'static/description/banner.jpg', + 'static/description/icon.png', + ], + 'installable': True, + 'auto_install': False, + 'application': True, +} diff --git a/personal_organiser/doc/RELEASE_NOTES.md b/personal_organiser/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..214488513 --- /dev/null +++ b/personal_organiser/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 29.03.2025 +#### Version 17.0.1.0.0 +##### ADD +- Initial commit for Personal Organiser diff --git a/personal_organiser/models/__init__.py b/personal_organiser/models/__init__.py new file mode 100644 index 000000000..ee69f8885 --- /dev/null +++ b/personal_organiser/models/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author:Athira K() +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import personal_organiser +from . import note_maker +from . import org_contacts diff --git a/personal_organiser/models/note_maker.py b/personal_organiser/models/note_maker.py new file mode 100644 index 000000000..0fcafbeb3 --- /dev/null +++ b/personal_organiser/models/note_maker.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author:Athira K() +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import models, fields + + +class NoteMaker(models.Model): + """This class is used to deal with notes""" + _name = "note.maker" + _description = "Note Maker" + + note = fields.Text(string="Note", help="Note") + user_id = fields.Many2one('res.users', string="User") + note_title = fields.Char(string="Title", help="Title") diff --git a/personal_organiser/models/org_contacts.py b/personal_organiser/models/org_contacts.py new file mode 100644 index 000000000..6d7d466b2 --- /dev/null +++ b/personal_organiser/models/org_contacts.py @@ -0,0 +1,30 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author:Athira K() +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import models, fields + + +class OrgContacts(models.Model): + """This class is used to deal with contacts""" + _name = "org.contacts" + _description = "Contacts" + + contact_id = fields.Many2one('res.partner', string="Contact") diff --git a/personal_organiser/models/personal_organiser.py b/personal_organiser/models/personal_organiser.py new file mode 100644 index 000000000..704243f66 --- /dev/null +++ b/personal_organiser/models/personal_organiser.py @@ -0,0 +1,33 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2025-TODAY Cybrosys Technologies() +# Author:Athira K() +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import models, fields + + +class PersonalOrganiser(models.Model): + """This class is used to cdeal with tasks""" + _name = "personal.organiser" + _description = "Personal Organiser" + + user_id = fields.Many2one('res.users', string="User") + task_title = fields.Char(required=True, string="Title", help="Title") + date = fields.Datetime(required=True, string="Date", help="Date") + calendar_event_id = fields.Many2one('calendar.event', string='Calendar Event', ondelete='set null') diff --git a/personal_organiser/security/ir.model.access.csv b/personal_organiser/security/ir.model.access.csv new file mode 100644 index 000000000..7d9a33f3c --- /dev/null +++ b/personal_organiser/security/ir.model.access.csv @@ -0,0 +1,4 @@ +id,name,model_id/id,group_id/id,perm_read,perm_write,perm_create,perm_unlink +access_personal_organiser,access_personal_organiser,model_personal_organiser,base.group_user,1,1,1,1 +access_note_maker,access_note_maker,model_note_maker,base.group_user,1,1,1,1 +access_org_contacts,access_org_contacts,model_org_contacts,base.group_user,1,1,1,1 diff --git a/personal_organiser/static/description/assets/icons/check.png b/personal_organiser/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/personal_organiser/static/description/assets/icons/check.png differ diff --git a/personal_organiser/static/description/assets/icons/chevron.png b/personal_organiser/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/personal_organiser/static/description/assets/icons/chevron.png differ diff --git a/personal_organiser/static/description/assets/icons/cogs.png b/personal_organiser/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/personal_organiser/static/description/assets/icons/cogs.png differ diff --git a/personal_organiser/static/description/assets/icons/consultation.png b/personal_organiser/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/personal_organiser/static/description/assets/icons/consultation.png differ diff --git a/personal_organiser/static/description/assets/icons/ecom-black.png b/personal_organiser/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/personal_organiser/static/description/assets/icons/ecom-black.png differ diff --git a/personal_organiser/static/description/assets/icons/education-black.png b/personal_organiser/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/personal_organiser/static/description/assets/icons/education-black.png differ diff --git a/personal_organiser/static/description/assets/icons/hotel-black.png b/personal_organiser/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/personal_organiser/static/description/assets/icons/hotel-black.png differ diff --git a/personal_organiser/static/description/assets/icons/license.png b/personal_organiser/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/personal_organiser/static/description/assets/icons/license.png differ diff --git a/personal_organiser/static/description/assets/icons/lifebuoy.png b/personal_organiser/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/personal_organiser/static/description/assets/icons/lifebuoy.png differ diff --git a/personal_organiser/static/description/assets/icons/manufacturing-black.png b/personal_organiser/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/personal_organiser/static/description/assets/icons/manufacturing-black.png differ diff --git a/personal_organiser/static/description/assets/icons/pos-black.png b/personal_organiser/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/personal_organiser/static/description/assets/icons/pos-black.png differ diff --git a/personal_organiser/static/description/assets/icons/puzzle.png b/personal_organiser/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/personal_organiser/static/description/assets/icons/puzzle.png differ diff --git a/personal_organiser/static/description/assets/icons/restaurant-black.png b/personal_organiser/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/personal_organiser/static/description/assets/icons/restaurant-black.png differ diff --git a/personal_organiser/static/description/assets/icons/service-black.png b/personal_organiser/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/personal_organiser/static/description/assets/icons/service-black.png differ diff --git a/personal_organiser/static/description/assets/icons/trading-black.png b/personal_organiser/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/personal_organiser/static/description/assets/icons/trading-black.png differ diff --git a/personal_organiser/static/description/assets/icons/training.png b/personal_organiser/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/personal_organiser/static/description/assets/icons/training.png differ diff --git a/personal_organiser/static/description/assets/icons/update.png b/personal_organiser/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/personal_organiser/static/description/assets/icons/update.png differ diff --git a/personal_organiser/static/description/assets/icons/user.png b/personal_organiser/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/personal_organiser/static/description/assets/icons/user.png differ diff --git a/personal_organiser/static/description/assets/icons/wrench.png b/personal_organiser/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/personal_organiser/static/description/assets/icons/wrench.png differ diff --git a/personal_organiser/static/description/assets/misc/Cybrosys R.png b/personal_organiser/static/description/assets/misc/Cybrosys R.png new file mode 100644 index 000000000..da4058087 Binary files /dev/null and b/personal_organiser/static/description/assets/misc/Cybrosys R.png differ diff --git a/personal_organiser/static/description/assets/misc/categories.png b/personal_organiser/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/personal_organiser/static/description/assets/misc/categories.png differ diff --git a/personal_organiser/static/description/assets/misc/check-box.png b/personal_organiser/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/personal_organiser/static/description/assets/misc/check-box.png differ diff --git a/personal_organiser/static/description/assets/misc/compass.png b/personal_organiser/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/personal_organiser/static/description/assets/misc/compass.png differ diff --git a/personal_organiser/static/description/assets/misc/corporate.png b/personal_organiser/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/personal_organiser/static/description/assets/misc/corporate.png differ diff --git a/personal_organiser/static/description/assets/misc/customer-support.png b/personal_organiser/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/personal_organiser/static/description/assets/misc/customer-support.png differ diff --git a/personal_organiser/static/description/assets/misc/cybrosys-logo.png b/personal_organiser/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/personal_organiser/static/description/assets/misc/cybrosys-logo.png differ diff --git a/personal_organiser/static/description/assets/misc/features.png b/personal_organiser/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/personal_organiser/static/description/assets/misc/features.png differ diff --git a/personal_organiser/static/description/assets/misc/logo.png b/personal_organiser/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/personal_organiser/static/description/assets/misc/logo.png differ diff --git a/personal_organiser/static/description/assets/misc/pictures.png b/personal_organiser/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/personal_organiser/static/description/assets/misc/pictures.png differ diff --git a/personal_organiser/static/description/assets/misc/pie-chart.png b/personal_organiser/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/personal_organiser/static/description/assets/misc/pie-chart.png differ diff --git a/personal_organiser/static/description/assets/misc/right-arrow.png b/personal_organiser/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/personal_organiser/static/description/assets/misc/right-arrow.png differ diff --git a/personal_organiser/static/description/assets/misc/star.png b/personal_organiser/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/personal_organiser/static/description/assets/misc/star.png differ diff --git a/personal_organiser/static/description/assets/misc/support.png b/personal_organiser/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/personal_organiser/static/description/assets/misc/support.png differ diff --git a/personal_organiser/static/description/assets/misc/whatsapp.png b/personal_organiser/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/personal_organiser/static/description/assets/misc/whatsapp.png differ diff --git a/personal_organiser/static/description/assets/modules/1.jpg b/personal_organiser/static/description/assets/modules/1.jpg new file mode 100644 index 000000000..67c7f7062 Binary files /dev/null and b/personal_organiser/static/description/assets/modules/1.jpg differ diff --git a/personal_organiser/static/description/assets/modules/2.jpg b/personal_organiser/static/description/assets/modules/2.jpg new file mode 100644 index 000000000..87c2bb2ba Binary files /dev/null and b/personal_organiser/static/description/assets/modules/2.jpg differ diff --git a/personal_organiser/static/description/assets/modules/3.png b/personal_organiser/static/description/assets/modules/3.png new file mode 100644 index 000000000..a5299d338 Binary files /dev/null and b/personal_organiser/static/description/assets/modules/3.png differ diff --git a/personal_organiser/static/description/assets/modules/4.png b/personal_organiser/static/description/assets/modules/4.png new file mode 100644 index 000000000..a0ac2d840 Binary files /dev/null and b/personal_organiser/static/description/assets/modules/4.png differ diff --git a/personal_organiser/static/description/assets/modules/5.jpg b/personal_organiser/static/description/assets/modules/5.jpg new file mode 100644 index 000000000..6a102f103 Binary files /dev/null and b/personal_organiser/static/description/assets/modules/5.jpg differ diff --git a/personal_organiser/static/description/assets/modules/6.jpg b/personal_organiser/static/description/assets/modules/6.jpg new file mode 100644 index 000000000..eaf13fef5 Binary files /dev/null and b/personal_organiser/static/description/assets/modules/6.jpg differ diff --git a/personal_organiser/static/description/assets/screenshots/1.png b/personal_organiser/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..dd3007b5f Binary files /dev/null and b/personal_organiser/static/description/assets/screenshots/1.png differ diff --git a/personal_organiser/static/description/assets/screenshots/2.png b/personal_organiser/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..326223b93 Binary files /dev/null and b/personal_organiser/static/description/assets/screenshots/2.png differ diff --git a/personal_organiser/static/description/assets/screenshots/3.png b/personal_organiser/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..8ce260b81 Binary files /dev/null and b/personal_organiser/static/description/assets/screenshots/3.png differ diff --git a/personal_organiser/static/description/assets/screenshots/4.png b/personal_organiser/static/description/assets/screenshots/4.png new file mode 100644 index 000000000..89cbaeea5 Binary files /dev/null and b/personal_organiser/static/description/assets/screenshots/4.png differ diff --git a/personal_organiser/static/description/assets/screenshots/5.png b/personal_organiser/static/description/assets/screenshots/5.png new file mode 100644 index 000000000..1ebcbdf49 Binary files /dev/null and b/personal_organiser/static/description/assets/screenshots/5.png differ diff --git a/personal_organiser/static/description/assets/screenshots/6.png b/personal_organiser/static/description/assets/screenshots/6.png new file mode 100644 index 000000000..cfbc92e41 Binary files /dev/null and b/personal_organiser/static/description/assets/screenshots/6.png differ diff --git a/personal_organiser/static/description/assets/screenshots/hero.gif b/personal_organiser/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..bd8cea8ea Binary files /dev/null and b/personal_organiser/static/description/assets/screenshots/hero.gif differ diff --git a/personal_organiser/static/description/banner.jpg b/personal_organiser/static/description/banner.jpg new file mode 100644 index 000000000..21a1580a9 Binary files /dev/null and b/personal_organiser/static/description/banner.jpg differ diff --git a/personal_organiser/static/description/icon.png b/personal_organiser/static/description/icon.png new file mode 100644 index 000000000..0ec4ecdde Binary files /dev/null and b/personal_organiser/static/description/icon.png differ diff --git a/personal_organiser/static/description/index.html b/personal_organiser/static/description/index.html new file mode 100644 index 000000000..bbde13a39 --- /dev/null +++ b/personal_organiser/static/description/index.html @@ -0,0 +1,776 @@ + + + + + + + Odoo App 3 Index + + + + + + + + +
+
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+
+
+
+

+ Personal Organiser

+

+ Efficiently manage one's notes, tasks, and events +

+
+ +
+
+
+
+
+

+ Key Highlights +

+
+
+
+
+
+ +
+
+

+ Note maker

+

Take a quick note from any view. +

+
+
+
+
+
+
+ +
+
+

+ Task manager

+

Manage your tasks and todo's more efficiently. +

+
+
+
+
+
+
+ +
+
+

+ Address book

+

Manage all contacts from here. +

+
+
+
+
+
+
+ +
+
+

+ Calender

+

Calender for a quick view of of tasks and todo's. +

+
+
+
+
+
+
+ +
+
+
+
+
+ +
+
+

+ All notemaker, task manager, calender, + and contacts + were available in the sidebar. +

+
+
+
+
+
+
+ +
+
+

+ Here you can add tasks with date. + Created tasks can be seen below as a list. + Options available to edit and delete tasks. +

+
+
+
+
+
+
+ +
+
+

+ Here you can add notes with title. + Created notes can be seen below as a list. + Options available to edit and delete notes. +

+
+
+
+
+
+
+ +
+
+

+ Here you can see all your contacts. + Also an option available to create a new one. +

+
+
+
+
+
+
+ +
+
+

+ Here you can view all your tasks and todo's + in a calender view. +

+
+
+
+
+
+
+ +
+
+

+ You can see a flag indicating count of tasks + expiring today. +

+
+
+
+
+
+
+
    +
  • + Helps to manage + tasks, todo's,and notes efficiently. +
  • +
  • + Available in + Odoo 17.0 + Community and Enterprise. +
  • +
+
+
+
+
+
+
Version + 17.0.1.0.0|Released on:17th October 2024 +
+

+ Initial Commit for Personal Organiser.

+
+
+
+
+
+
+
+

+ Related Products

+
+
+ +
+
+

+ Our Services

+ +
+
+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Customization

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Implementation

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Support

+
+
+
+
+
+
+ service-icon +
+
+

Hire + Odoo Developer

+
+
+
+
+ +
+
+ service-icon +
+
+

Odoo + Integration

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Migration

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Consultancy

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Implementation

+
+
+
+
+
+
+ service-icon +
+
+

Odoo + Licensing Consultancy

+
+
+
+
+
+
+

+ Our Industries

+ +
+
+
+
+
+
+ +

Trading

+

Easily procure and sell your products

+
+
+
+
+ +

POS

+

Easy configuration and convivial experience

+
+
+
+
+ +

+ Education

+

A platform for educational management

+
+
+
+
+ +

+ Manufacturing

+

Plan, track and schedule your operations

+
+
+
+
+ +

E-commerce & + Website

+

Mobile friendly, awe-inspiring product pages

+
+
+
+
+ +

Service + Management

+

Keep track of services and invoice

+
+
+
+
+ +

+ Restaurant

+

Run your bar or restaurant methodically

+
+
+
+
+ +

Hotel + Management

+

An all-inclusive hotel management application

+
+
+
+
+
+
+

+ Support

+
+
+
+
+
+
+
+ +
+ Need + Help? +

Got + questions or need help? Get in + touch.

+
odoo@cybrosys.com +
+
+
+
+
+
+
+
+ +
+ WhatsApp +

Say hi + to + us on WhatsApp!

+
+91 + 99456767686 +
+
+
+
+
+
+
+
+
+ + + + + + diff --git a/personal_organiser/static/src/img/bin.png b/personal_organiser/static/src/img/bin.png new file mode 100644 index 000000000..c51c50c9a Binary files /dev/null and b/personal_organiser/static/src/img/bin.png differ diff --git a/personal_organiser/static/src/img/checklist.png b/personal_organiser/static/src/img/checklist.png new file mode 100644 index 000000000..b314af595 Binary files /dev/null and b/personal_organiser/static/src/img/checklist.png differ diff --git a/personal_organiser/static/src/img/note-taking.png b/personal_organiser/static/src/img/note-taking.png new file mode 100644 index 000000000..e9c9db2e9 Binary files /dev/null and b/personal_organiser/static/src/img/note-taking.png differ diff --git a/personal_organiser/static/src/img/support.png b/personal_organiser/static/src/img/support.png new file mode 100644 index 000000000..4f3f9a341 Binary files /dev/null and b/personal_organiser/static/src/img/support.png differ diff --git a/personal_organiser/static/src/img/weekend.png b/personal_organiser/static/src/img/weekend.png new file mode 100644 index 000000000..379e29455 Binary files /dev/null and b/personal_organiser/static/src/img/weekend.png differ diff --git a/personal_organiser/static/src/scss/mixins.scss b/personal_organiser/static/src/scss/mixins.scss new file mode 100644 index 000000000..10896ed1c --- /dev/null +++ b/personal_organiser/static/src/scss/mixins.scss @@ -0,0 +1,7 @@ +@mixin disable-scrollbar { + scrollbar-width: none; + -ms-overflow-style: none; + &::-webkit-scrollbar { + display: none; + } +} diff --git a/personal_organiser/static/src/scss/variables.dark.scss b/personal_organiser/static/src/scss/variables.dark.scss new file mode 100644 index 000000000..1b9631bb7 --- /dev/null +++ b/personal_organiser/static/src/scss/variables.dark.scss @@ -0,0 +1,2 @@ +$appbar-color: #E4E4E4 !default; +$appbar-background: #3C3E4B !default; diff --git a/personal_organiser/static/src/scss/variables.scss b/personal_organiser/static/src/scss/variables.scss new file mode 100644 index 000000000..767686b0c --- /dev/null +++ b/personal_organiser/static/src/scss/variables.scss @@ -0,0 +1,3 @@ +$appbar-color: #dee2e6 !default; +$appbar-active: $o-brand-primary !default; +$appbar-background: #111827 !default; diff --git a/personal_organiser/static/src/webclient/calender/calender.js b/personal_organiser/static/src/webclient/calender/calender.js new file mode 100644 index 000000000..b6f5a7323 --- /dev/null +++ b/personal_organiser/static/src/webclient/calender/calender.js @@ -0,0 +1,95 @@ +/** @odoo-module **/ +import { Component, useState } from '@odoo/owl'; +import { useService } from '@web/core/utils/hooks'; + +export class MiniCalendar extends Component { + "Component to deal with calendar events" + static template = 'personal_organiser.mini_calendar'; + + setup() { + this.orm = useService('orm'); + this.user = useService('user'); // Add user service to get current user info + this.currentDate = new Date(); + this.state = useState({ + daysInMonth: [], // Days in the current month with event flags + selectedDate: null, // Currently selected date + selectedDayEvents: [], // Events for the selected date + }); + this.loadEvents(); // Load all events on component setup + } + + // Method to load events from the backend + async loadEvents() { + const today = this.formatDate(new Date()); // Current date in YYYY-MM-DD format + try { + // Fetch events that start after today AND belong to the current user + this.events = await this.orm.searchRead("calendar.event", [ + ["start_date", ">=", today], + ["user_id", "=", this.user.userId], // Filter by current user + ]); + } catch (error) { + console.error("Error loading events:", error); + } + this.updateCalendar(); // Update the calendar once events are loaded + } + + // Method to update the calendar view with event flags + updateCalendar() { + const year = this.currentDate.getFullYear(); + const month = this.currentDate.getMonth(); + const lastDate = new Date(year, month + 1, 0).getDate(); + + // Generate days for the current month and check if they have events + this.state.daysInMonth = Array.from({ length: lastDate }, (_, day) => { + const currentDay = day + 1; + const currentDate = new Date(year, month, currentDay); + const hasEvent = this.events.some(event => { + const eventDateString = event.start_date; + const eventDate = new Date(`${eventDateString}T00:00:00`); + const normalizedEventDate = new Date(eventDate.getFullYear(), + eventDate.getMonth(), eventDate.getDate()); + const normalizedCurrentDate = new Date(currentDate.getFullYear(), + currentDate.getMonth(), currentDate.getDate()); + return normalizedEventDate.getTime() === normalizedCurrentDate.getTime(); + }); + return { + date: currentDate, + hasEvent, + }; + }); + } + + // Method to handle day selection and load events for the selected day + async selectDay(day) { + this.state.selectedDate = day.date; + await this.fetchEventsForDay(day.date); // Fetch events for the selected day + } + + // Fetch events for the selected day + async fetchEventsForDay(date) { + try { + const dateStr = this.formatDate(date); // Format the date as YYYY-MM-DD + const events = await this.orm.searchRead('calendar.event', [ + ['start_date', '=', dateStr], // Query events for this date + ['user_id', '=', this.user.userId], // Filter by current user + ], ['name', 'description', 'start_date']); + + this.state.selectedDayEvents = events; // Set the events for the selected day + } catch (error) { + console.error("Error fetching events:", error); + } + } + + // Helper function to format date as YYYY-MM-DD (handling timezone correctly) + formatDate(date) { + // Set the time to 00:00:00 for consistency + date.setHours(0, 0, 0, 0); + + // Format the date to YYYY-MM-DD + const year = date.getFullYear(); + const month = String(date.getMonth() + 1).padStart(2, '0'); // Months are 0-indexed + const day = String(date.getDate()).padStart(2, '0'); + + return `${year}-${month}-${day}`; + } +} \ No newline at end of file diff --git a/personal_organiser/static/src/webclient/calender/calender.scss b/personal_organiser/static/src/webclient/calender/calender.scss new file mode 100644 index 000000000..e25f38da3 --- /dev/null +++ b/personal_organiser/static/src/webclient/calender/calender.scss @@ -0,0 +1,97 @@ +/* The main container for the calendar */ +.calendar { + float: left; + background-color: #f7f7f7; /* Light background color for better contrast */ + justify-content: space-between; + white-space: nowrap; + height: 100%; + padding-top: 20px; + padding-bottom: 20px; /* Added padding for better spacing */ + border-radius: 8px; /* Rounded corners */ +} + +/* Mini Calendar container */ +.mini-calendar { + display: flex; + flex-direction: column; + align-items: center; + width: 100%; /* Ensure it takes full available width */ + max-width: 400px; /* Optional: limits the width on large screens */ + margin: auto; /* Centering the calendar */ +} + +/* Calendar header */ +.calendar-header { + margin-bottom: 10px; + text-align: center; + font-size: 1.2em; + font-weight: bold; +} + +/* Grid layout for the calendar days */ +.calendar-days { + display: grid; + grid-template-columns: repeat(7, 1fr); /* 7 days in a week */ + gap: 5px; + width: 100%; +} + +/* Individual day cell */ +.calendar-day { + height: 40px; /* Increased the height for better visibility */ + display: flex; + justify-content: center; + align-items: center; + border: 1px solid #ddd; + border-radius: 50%; /* Circular appearance for days */ + font-size: 1em; /* Adjust font size */ + transition: background-color 0.3s, transform 0.2s; /* Smooth transition for hover */ + cursor: pointer; /* Show pointer cursor when hovering */ + margin: 2px; /* Slight margin to create a gap between the cells */ +} + +/* Hover effect for clickable days */ +.calendar-day:hover { + background-color: #e0e0e0; /* Lighter background on hover */ + transform: scale(1.1); /* Slight scale effect when hovered */ +} + +/* Highlight days with events (with a slight gap) */ +.calendar-day.calendar-event { + background-color: #4caf50; /* Green background for days with events */ + color: white; + font-weight: bold; + margin: 5px; /* Add margin for gap between event days */ +} + +/* Selected day styling */ +.calendar-day.selected { + background-color: #2196f3; /* Blue color for selected day */ + color: white; + font-weight: bold; +} + +/* Event cards section */ +.event-cards .card { + margin-bottom: 10px; + border: 1px solid #ccc; + padding: 10px; + border-radius: 8px; + background-color: #fff; + box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1); /* Slight shadow for depth */ +} + +.event-cards .card-title { + font-weight: bold; + font-size: 1.1em; +} + +.event-cards .card-text { + font-size: 0.9em; + color: #555; +} + +.event-cards .text-muted { + font-size: 0.8em; + color: #777; +} diff --git a/personal_organiser/static/src/webclient/calender/calender.xml b/personal_organiser/static/src/webclient/calender/calender.xml new file mode 100644 index 000000000..de49fc846 --- /dev/null +++ b/personal_organiser/static/src/webclient/calender/calender.xml @@ -0,0 +1,51 @@ + + + +
+
+

+ + +

+
+
+ + +
+ +
+
+
+ +

No days to display.

+
+
+
+ + + +
+
+

Events on

+
+ +
+
+
+ +
+
+
+
+
+
+ +


No events for this day.

+
+
+
\ No newline at end of file diff --git a/personal_organiser/static/src/webclient/contacts/contacts.js b/personal_organiser/static/src/webclient/contacts/contacts.js new file mode 100644 index 000000000..b4b437f0e --- /dev/null +++ b/personal_organiser/static/src/webclient/contacts/contacts.js @@ -0,0 +1,49 @@ +/** @odoo-module **/ +import { Component,useState } from "@odoo/owl"; +import { useService } from "@web/core/utils/hooks"; +export class OrgContacts extends Component { + "component to manage all the contacts" + static template = 'personal_organiser.orgcontacts'; + setup() { + this.orm = useService("orm"); + this.state = useState({ + contacts: [], + name: '', + email: '', + showInputFields: false, + }); + this.fetchContacts(); + } + async fetchContacts() { + try { + this.state.contacts = await this.orm.searchRead("res.partner", [], + ['name', 'email','image_1920']); + } catch (error) { + console.error('Error fetching contacts:', error); + } + } + toggleInputFields() { + this.state.showInputFields = !this.state.showInputFields; + } + + async createContact() { + try { + const contactData = { + name: this.state.name, + email: this.state.email, + }; + + const partnerId = await this.orm.create('res.partner', [contactData]); + this.state.name = ''; + this.state.email = ''; + this.state.showInputFields = false; + } catch (error) { + console.error('Error creating contact:', error); + } + } + onClickDiv(event) { + console.log(event,"event") + const el = event.srcElement.nextSibling; + el.style.display = (el.style.display === "block") ? "none" : "block"; + } +} \ No newline at end of file diff --git a/personal_organiser/static/src/webclient/contacts/contacts.scss b/personal_organiser/static/src/webclient/contacts/contacts.scss new file mode 100644 index 000000000..30ce7f4bd --- /dev/null +++ b/personal_organiser/static/src/webclient/contacts/contacts.scss @@ -0,0 +1,8 @@ +.contacts-container { + float:left; + background-color: light; + justify-content: space-between; + white-space: nowrap; + height: 100%; + padding-top: 20px; +} \ No newline at end of file diff --git a/personal_organiser/static/src/webclient/contacts/contacts.xml b/personal_organiser/static/src/webclient/contacts/contacts.xml new file mode 100644 index 000000000..951c31924 --- /dev/null +++ b/personal_organiser/static/src/webclient/contacts/contacts.xml @@ -0,0 +1,48 @@ + + + +
+
+

Contacts

+ + + +
+
+ + + +
+ +
+
+ +
+
+
+ +
+ +
+
+
+
+
+
+
+
+
diff --git a/personal_organiser/static/src/webclient/layout.js b/personal_organiser/static/src/webclient/layout.js new file mode 100644 index 000000000..49df7e69f --- /dev/null +++ b/personal_organiser/static/src/webclient/layout.js @@ -0,0 +1,10 @@ +/** @odoo-module **/ +import { patch } from "@web/core/utils/patch"; +import { WebClient } from '@web/webclient/webclient'; +import {Sidebar} from "@personal_organiser/webclient/sidebar/sidebar"; +patch(WebClient, { + components: { + ...WebClient.components, + Sidebar, + }, +}) diff --git a/personal_organiser/static/src/webclient/layout.scss b/personal_organiser/static/src/webclient/layout.scss new file mode 100644 index 000000000..08cfd7331 --- /dev/null +++ b/personal_organiser/static/src/webclient/layout.scss @@ -0,0 +1,52 @@ +.o_web_client { + display: grid !important; + grid-template-areas: + "banner banner" + "navbar navbar" + "components components" + "content sidebar"; + grid-template-columns: 1fr 100px; + grid-template-rows: auto auto 1fr; + + > div:has(#oe_neutralize_banner) { + grid-area: banner; + } + > .o_navbar { + grid-area: navbar; + } + > .o_action_manager { + grid-area: content; + } + > .o-main-components-container { + grid-area: components; + } + > .sidebar_panel { + grid-area: sidebar; + width: 100px; /* Fixed width for the sidebar */ + overflow-y: auto; /* Allow scrolling if content overflows */ + padding-top:0px; + } + > .task, > .note, > .contacts, > .calender { + grid-row: 4; /* Ensure all organizers occupy the same grid row */ + width: 300px; /* Fixed width for the organizers */ + } + + /* Responsive styles */ + @media (max-width: 700px) { + .o_web_client { + grid-template-areas: + "banner" + "navbar" + "components" + "content" + "sidebar"; /* Stack elements vertically */ + grid-template-columns: 1fr; /* Full width for all items */ + } + > .sidebar_panel { + width: 100%; /* Make sidebar full width on small screens */ + } + > .task, > .note, > .contacts, > .calender { + width: 100%; /* Make organizers full width on small screens */ + } + } +} diff --git a/personal_organiser/static/src/webclient/layout.xml b/personal_organiser/static/src/webclient/layout.xml new file mode 100644 index 000000000..f707c9e01 --- /dev/null +++ b/personal_organiser/static/src/webclient/layout.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/personal_organiser/static/src/webclient/notemaker/notemaker.js b/personal_organiser/static/src/webclient/notemaker/notemaker.js new file mode 100644 index 000000000..f65c8e843 --- /dev/null +++ b/personal_organiser/static/src/webclient/notemaker/notemaker.js @@ -0,0 +1,110 @@ +/** @odoo-module **/ +import { Component, useState } from "@odoo/owl"; +import { useService } from "@web/core/utils/hooks"; + +export class NoteMaker extends Component { + /** + * Component to manage notes. + */ + static template = 'personal_organiser.notemaker'; + + setup() { + this.orm = useService("orm"); + this.state = useState({ + newNote: '', + note_title: '', + notes: [], + }); + this.fetchUserNotes(); + } + + /** + * Fetches all notes for the current user and updates the state. + */ + async fetchUserNotes() { + try { + this.state.notes = await this.orm.searchRead("note.maker", + [["user_id", "=", this.orm.user.userId]], + ['id', 'note_title', 'note'] + ); + } catch (error) { + console.error("Error fetching notes:", error); + } + } + + /** + * Adds a new note for the user. + */ + async addNote() { + if (!this.state.newNote || !this.state.note_title) { + console.log("Note title and content cannot be empty."); + return; + } + + try { + const [noteId] = await this.orm.create("note.maker", [{ + user_id: this.orm.user.userId, + note: this.state.newNote, + note_title: this.state.note_title, + }]); + + const newNote = { + id: noteId, + note_title: this.state.note_title, + note: this.state.newNote, + }; + + this.state.notes.push(newNote); + + // Clear the input fields + this.state.newNote = ''; + this.state.note_title = ''; + } catch (error) { + console.error("Error adding note:", error); + } + } + + /** + * Deletes a note by its ID. + */ + async deleteNote(note) { + if (note.id) { + try { + await this.orm.unlink("note.maker", [note.id]); + this.state.notes = this.state.notes.filter(n => n.id !== note.id); + console.log("Note deleted successfully"); + } catch (error) { + console.error("Error deleting note:", error); + } + } else { + console.error("Note ID is missing:", note); + } + } + + /** + * Toggles the edit mode for a note. + */ + editNote(note) { + note.isEditing = !note.isEditing; + } + + /** + * Saves changes made to a note. + */ + async saveNote(note) { + if (note.id) { + try { + await this.orm.write("note.maker", [note.id], { + note_title: note.note_title, + note: note.note, + }); + note.isEditing = false; + console.log("Note updated successfully"); + } catch (error) { + console.error("Error saving note:", error); + } + } else { + console.error("Note ID is missing:", note); + } + } +} diff --git a/personal_organiser/static/src/webclient/notemaker/notemaker.scss b/personal_organiser/static/src/webclient/notemaker/notemaker.scss new file mode 100644 index 000000000..f3c78be2c --- /dev/null +++ b/personal_organiser/static/src/webclient/notemaker/notemaker.scss @@ -0,0 +1,6 @@ +.note-maker { + justify-content: space-between; + white-space: nowrap; + height: 100%; + padding-top: 20px; +} \ No newline at end of file diff --git a/personal_organiser/static/src/webclient/notemaker/notemaker.xml b/personal_organiser/static/src/webclient/notemaker/notemaker.xml new file mode 100644 index 000000000..284f7f9ff --- /dev/null +++ b/personal_organiser/static/src/webclient/notemaker/notemaker.xml @@ -0,0 +1,61 @@ + + + +
+

Notes

+
+ + + +
+
+ +

Notes

+
+
+ +
+ +
+ +
+
+
+
+ +
+ + + +
+ +
+ +
+ +
+ +
+
+
+
+ +
+
+ + \ No newline at end of file diff --git a/personal_organiser/static/src/webclient/personalorganiser/organizer.scss b/personal_organiser/static/src/webclient/personalorganiser/organizer.scss new file mode 100644 index 000000000..f9aa4bd9f --- /dev/null +++ b/personal_organiser/static/src/webclient/personalorganiser/organizer.scss @@ -0,0 +1,8 @@ +.sidebar_panel { + float:left; + background-color: grey; + justify-content: space-between; + white-space: nowrap; + height: 100%; + padding-top: 20px; +} diff --git a/personal_organiser/static/src/webclient/personalorganiser/personal_organiser.js b/personal_organiser/static/src/webclient/personalorganiser/personal_organiser.js new file mode 100644 index 000000000..c86c4a539 --- /dev/null +++ b/personal_organiser/static/src/webclient/personalorganiser/personal_organiser.js @@ -0,0 +1,230 @@ +/** @odoo-module **/ +import { Component, useState } from "@odoo/owl"; +import { useService } from "@web/core/utils/hooks"; + +export class PersonalOrganizer extends Component { + static template = 'personal_organiser.task'; + + setup() { + this.orm = useService("orm"); + this.action = useService("action"); + this.notification = useService("notification"); + this.state = useState({ + newTask: '', + date: '', + tasks: [], + }); + this.fetchUserData(); + } + + async fetchUserData() { + try { + const tasks = await this.orm.searchRead("personal.organiser", [ + ["user_id", "=", this.orm.user.userId] + ], ['task_title', 'date', 'id']); + + // Ensure dates are properly formatted + this.state.tasks = tasks.map(task => ({ + ...task, + date: task.date ? task.date.split(' ')[0] : '', // Extract just the date part + })); + + // Sort tasks by date + this.state.tasks.sort((a, b) => new Date(a.date) - new Date(b.date)); + } catch (error) { + console.error('Error fetching user data:', error); + this.notification.notify({ + title: 'Error', + message: 'Failed to fetch tasks', + type: 'danger', + }); + } + } + + async refreshCalendarView() { + try { + // Check if user has access to calendar events + const hasAccess = await this.orm.call( + 'calendar.event', + 'check_access_rights', + ['read'], + { raise_exception: false } + ); + + if (hasAccess) { + // Reload calendar view + await this.action.doAction({ + type: 'ir.actions.client', + tag: 'reload', + params: { + model: 'calendar.event', + view_type: 'calendar' + } + }); + } + } catch (error) { + console.error('Error refreshing calendar:', error); + } +} + + async addTask() { + if (!this.state.newTask || !this.state.date) { + this.notification.notify({ + title: 'Warning', + message: 'Please enter both task title and date', + type: 'warning', + }); + return; + } + + const taskData = { + user_id: this.orm.user.userId, + date: this.state.date, + task_title: this.state.newTask, + }; + + try { + // Create task in personal.organiser + const taskId = await this.orm.create("personal.organiser", [taskData]); + + // Create event in calendar + const calendarEventId = await this.orm.create("calendar.event", [{ + name: this.state.newTask, + start: this.state.date, + stop: this.state.date, + start_date: this.state.date, + stop_date: this.state.date, + user_id: this.orm.user.userId, + allday: true, + }]); + + // Add complete task data to state + const newTask = { + id: taskId[0], + calendar_event_id: calendarEventId[0], + task_title: this.state.newTask, + date: this.state.date, + user_id: this.orm.user.userId, + }; + + // Add to state and sort + this.state.tasks.push(newTask); + this.state.tasks.sort((a, b) => new Date(a.date) - new Date(b.date)); + + // Clear input fields + this.state.newTask = ''; + this.state.date = ''; + + // Refresh calendar view + await this.refreshCalendarView(); + + } catch (error) { + console.error('Error adding task:', error); + this.notification.notify({ + title: 'Error', + message: 'Failed to add task', + type: 'danger', + }); + } + } + + async deleteTask(task) { + try { + // Find all related calendar events + const calendarEvents = await this.orm.searchRead("calendar.event", [ + ["name", "=", task.task_title], + ["user_id", "=", this.orm.user.userId] + ], ['id']); + + // Remove the task from state + this.state.tasks = this.state.tasks.filter(t => t.id !== task.id); + + // Delete from personal.organiser + await this.orm.unlink("personal.organiser", [task.id]); + + // Delete all related calendar events + if (calendarEvents && calendarEvents.length > 0) { + const calendarEventIds = calendarEvents.map(event => event.id); + await this.orm.unlink("calendar.event", calendarEventIds); + } + + // Refresh calendar view + await this.refreshCalendarView(); + + } catch (error) { + console.error('Error deleting task:', error); + this.notification.notify({ + title: 'Error', + message: 'Failed to delete task', + type: 'danger', + }); + } + } + + async onInputChange(event, task, field) { + const oldValue = task[field]; + const newValue = event.target.value; + + // Validate date if updating date field + if (field === 'date' && !newValue) { + this.notification.notify({ + title: 'Warning', + message: 'Please enter a valid date', + type: 'warning', + }); + return; + } + + try { + // First find all existing calendar events with the old title + const oldCalendarEvents = await this.orm.searchRead("calendar.event", [ + ["name", "=", task.task_title], + ["user_id", "=", this.orm.user.userId] + ], ['id']); + + // Delete old calendar events + if (oldCalendarEvents && oldCalendarEvents.length > 0) { + const oldEventIds = oldCalendarEvents.map(event => event.id); + await this.orm.unlink("calendar.event", oldEventIds); + } + + // Update personal.organiser + await this.orm.write("personal.organiser", [task.id], { + [field]: newValue + }); + + // Create new calendar event + const calendarEventId = await this.orm.create("calendar.event", [{ + name: field === 'task_title' ? newValue : task.task_title, + start: field === 'date' ? newValue : task.date, + stop: field === 'date' ? newValue : task.date, + start_date: field === 'date' ? newValue : task.date, + stop_date: field === 'date' ? newValue : task.date, + user_id: this.orm.user.userId, + allday: true, + }]); + + // Update task in state + task[field] = newValue; + task.calendar_event_id = calendarEventId[0]; + + // Resort tasks if date was changed + if (field === 'date') { + this.state.tasks.sort((a, b) => new Date(a.date) - new Date(b.date)); + } + + // Refresh calendar view + await this.refreshCalendarView(); + + } catch (error) { + console.error('Error updating task:', error); + // Revert the state change on error + task[field] = oldValue; + this.notification.notify({ + title: 'Error', + message: 'Failed to update task', + type: 'danger', + }); + } + } +} \ No newline at end of file diff --git a/personal_organiser/static/src/webclient/personalorganiser/personal_organiser.xml b/personal_organiser/static/src/webclient/personalorganiser/personal_organiser.xml new file mode 100644 index 000000000..5fdeb5c0e --- /dev/null +++ b/personal_organiser/static/src/webclient/personalorganiser/personal_organiser.xml @@ -0,0 +1,67 @@ + + + +
+