diff --git a/todoist_project/README.rst b/todoist_project/README.rst new file mode 100755 index 000000000..6f6486195 --- /dev/null +++ b/todoist_project/README.rst @@ -0,0 +1,41 @@ +.. image:: https://img.shields.io/badge/license-LGPL--3-blue.svg + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 + +Todoist Integration +=================== +This module enables the integration of Todoist and Odoo. + +Configuration +============= +- Create a todoist token from todoist account and sync the data with odoo. + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +Developer: (V16) Sayanth M 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/todoist_project/__init__.py b/todoist_project/__init__.py new file mode 100644 index 000000000..e91d5fb58 --- /dev/null +++ b/todoist_project/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Sayanth M K() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import models diff --git a/todoist_project/__manifest__.py b/todoist_project/__manifest__.py new file mode 100644 index 000000000..fc8824ecd --- /dev/null +++ b/todoist_project/__manifest__.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Sayanth M K() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +{ + 'name': "Todoist Integration", + 'version': '16.0.1.0.0', + 'category': 'Project', + 'summary': """This module enables the integration of Todoist and Odoo.""", + 'description': """This module enables the integration of Todoist and Odoo. + Projects and tasks from Todoist to Odoo will be managed in this way.""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'depends': ['project'], + 'data': [ + 'views/res_users_views.xml', + ], + 'external_dependencies': { + 'python': ['todoist-python'], + }, + 'images': ['static/description/banner.png'], + 'license': 'LGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/todoist_project/doc/RELEASE_NOTES.md b/todoist_project/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..b905746b0 --- /dev/null +++ b/todoist_project/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 30.01.2024 +#### Version 16.0.1.0.0 +##### ADD + +- Initial commit for Todoist Integration diff --git a/todoist_project/models/__init__.py b/todoist_project/models/__init__.py new file mode 100644 index 000000000..6276d1806 --- /dev/null +++ b/todoist_project/models/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Sayanth M K() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import project_project +from . import project_task +from . import res_users diff --git a/todoist_project/models/project_project.py b/todoist_project/models/project_project.py new file mode 100644 index 000000000..8587a4cdc --- /dev/null +++ b/todoist_project/models/project_project.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Sayanth M K() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import fields, models + + +class ProjectProject(models.Model): + """Extends project_project model to add a todo_project field.""" + _inherit = 'project.project' + + todo_project = fields.Char(string='Todo Project', + help='Description or additional information ' + 'about the Todo Project') diff --git a/todoist_project/models/project_task.py b/todoist_project/models/project_task.py new file mode 100644 index 000000000..39127e3ca --- /dev/null +++ b/todoist_project/models/project_task.py @@ -0,0 +1,31 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Sayanth M K() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import fields, models + + +class ProjectTask(models.Model): + """Extends project_task model to add a todo_task field.""" + _inherit = 'project.task' + + todo_task = fields.Char(string='Todo Task', + help='Description or additional information about' + ' the Todo Task') diff --git a/todoist_project/models/res_users.py b/todoist_project/models/res_users.py new file mode 100644 index 000000000..0f2552d86 --- /dev/null +++ b/todoist_project/models/res_users.py @@ -0,0 +1,105 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Sayanth M K() +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from .todoist_api_python.api import TodoistAPI +from odoo import fields, models, _ +from odoo.exceptions import MissingError + + +def _get_todoist_projects_tasks(token, project=False): + """Fetch Projects and Tasks from API""" + try: + return TodoistAPI( + token).get_projects() if project else TodoistAPI(token).get_tasks() + except Exception as error: + return error + + +class ResUsers(models.Model): + """Extends res_users model to integrate Todoist functionality.""" + _inherit = 'res.users' + + todoist_token = fields.Char(string='Todoist Token', + help='todoist auth token to retrieve data' + ' from todoist', + copy=False) + + def _fetch_token(self): + """Method to fetch a token from user""" + if self.todoist_token: + return self.todoist_token + raise MissingError('Token not found!') + + def _add_all_projects(self): + """Add all projects or Write projects with updated data from API""" + for project in _get_todoist_projects_tasks(self._fetch_token(), + project=True): + vals = {'todo_project': str(project.id), 'name': project.name} + exist = self.env['project.project'].sudo().search( + [('todo_project', '=', vals['todo_project'])], + limit=1) + exist.write(vals) if exist else self.env[ + 'project.project'].sudo().create(vals) + + def _add_task_tags(self, tags): + """Add all tags or Write tags with updated data from API""" + TagModel = self.env['project.tags'] + existing_tags = {tag.name: tag for tag in + TagModel.sudo().search([('name', 'in', tags)])} + created_tags = TagModel.sudo().create( + [{'name': tag} for tag in tags if tag not in existing_tags]) + existing_tags.update({tag.name: tag for tag in created_tags}) + return [existing_tags[tag].id for tag in tags] + + def _add_all_tasks(self): + """Add all tasks or Write tasks with updated data from API""" + ProjectModel = self.env['project.project'] + TaskModel = self.env['project.task'] + for task in _get_todoist_projects_tasks(self._fetch_token(), + project=False): + task_vals = { + 'project_id': ProjectModel.sudo().search( + [('todo_project', '=', str(task.project_id))], limit=1).id, + 'name': task.content, + 'todo_task': str(task.id), + 'date_deadline': task.due.date if task.due else False, + 'tag_ids': [(6, 0, self._add_task_tags(task.labels))], + 'description': task.description if task.description else False, + } + existing_task = TaskModel.sudo().search( + [('todo_task', '=', task_vals['todo_task'])], limit=1) + existing_task.write( + task_vals) if existing_task else TaskModel.sudo().create( + task_vals) + + def action_sync_todoist_with_odoo(self): + """Sync the Todoist with odoo""" + self._add_all_projects() + self._add_all_tasks() + return { + 'type': 'ir.actions.client', + 'tag': 'display_notification', + 'params': { + 'type': 'success', + 'message': (_("Successfully Synchronized Data!")), + 'next': {'type': 'ir.actions.act_window_close'}, + } + } diff --git a/todoist_project/models/todoist_api_python/__init__.py b/todoist_project/models/todoist_api_python/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/todoist_project/models/todoist_api_python/api.py b/todoist_project/models/todoist_api_python/api.py new file mode 100644 index 000000000..0c5819e87 --- /dev/null +++ b/todoist_project/models/todoist_api_python/api.py @@ -0,0 +1,210 @@ +from __future__ import annotations + +from typing import Any, Dict, List + +import requests + +from ..todoist_api_python.endpoints import ( + COLLABORATORS_ENDPOINT, + COMMENTS_ENDPOINT, + LABELS_ENDPOINT, + PROJECTS_ENDPOINT, + QUICK_ADD_ENDPOINT, + SECTIONS_ENDPOINT, + SHARED_LABELS_ENDPOINT, + SHARED_LABELS_REMOVE_ENDPOINT, + SHARED_LABELS_RENAME_ENDPOINT, + TASKS_ENDPOINT, + get_rest_url, + get_sync_url, +) +from ..todoist_api_python.http_requests import delete, get, post +from ..todoist_api_python.models import ( + Collaborator, + Comment, + Label, + Project, + QuickAddResult, + Section, + Task, +) + + +class TodoistAPI: + def __init__(self, token: str, session: requests.Session | None = None) -> None: + self._token: str = token + self._session = session or requests.Session() + + def get_task(self, task_id: str) -> Task: + endpoint = get_rest_url(f"{TASKS_ENDPOINT}/{task_id}") + task = get(self._session, endpoint, self._token) + return Task.from_dict(task) + + def get_tasks(self, **kwargs) -> List[Task]: + ids = kwargs.pop("ids", None) + + if ids: + kwargs.update({"ids": ",".join(str(i) for i in ids)}) + + endpoint = get_rest_url(TASKS_ENDPOINT) + tasks = get(self._session, endpoint, self._token, kwargs) + return [Task.from_dict(obj) for obj in tasks] + + def add_task(self, content: str, **kwargs) -> Task: + endpoint = get_rest_url(TASKS_ENDPOINT) + data: Dict[str, Any] = {"content": content} + data.update(kwargs) + task = post(self._session, endpoint, self._token, data=data) + return Task.from_dict(task) + + def update_task(self, task_id: str, **kwargs) -> bool: + endpoint = get_rest_url(f"{TASKS_ENDPOINT}/{task_id}") + return post(self._session, endpoint, self._token, data=kwargs) + + def close_task(self, task_id: str, **kwargs) -> bool: + endpoint = get_rest_url(f"{TASKS_ENDPOINT}/{task_id}/close") + return post(self._session, endpoint, self._token, data=kwargs) + + def reopen_task(self, task_id: str, **kwargs) -> bool: + endpoint = get_rest_url(f"{TASKS_ENDPOINT}/{task_id}/reopen") + return post(self._session, endpoint, self._token, data=kwargs) + + def delete_task(self, task_id: str, **kwargs) -> bool: + endpoint = get_rest_url(f"{TASKS_ENDPOINT}/{task_id}") + return delete(self._session, endpoint, self._token, args=kwargs) + + def quick_add_task(self, text: str) -> QuickAddResult: + endpoint = get_sync_url(QUICK_ADD_ENDPOINT) + data = { + "text": text, + "meta": True, + "auto_reminder": True, + } + task_data = post(self._session, endpoint, self._token, data=data) + return QuickAddResult.from_quick_add_response(task_data) + + def get_project(self, project_id: str) -> Project: + endpoint = get_rest_url(f"{PROJECTS_ENDPOINT}/{project_id}") + project = get(self._session, endpoint, self._token) + return Project.from_dict(project) + + def get_projects(self) -> List[Project]: + print('eeeeeeee') + endpoint = get_rest_url(PROJECTS_ENDPOINT) + projects = get(self._session, endpoint, self._token) + return [Project.from_dict(obj) for obj in projects] + + def add_project(self, name: str, **kwargs) -> Project: + endpoint = get_rest_url(PROJECTS_ENDPOINT) + data: Dict[str, Any] = {"name": name} + data.update(kwargs) + project = post(self._session, endpoint, self._token, data=data) + return Project.from_dict(project) + + def update_project(self, project_id: str, **kwargs) -> bool: + endpoint = get_rest_url(f"{PROJECTS_ENDPOINT}/{project_id}") + return post(self._session, endpoint, self._token, data=kwargs) + + def delete_project(self, project_id: str, **kwargs) -> bool: + endpoint = get_rest_url(f"{PROJECTS_ENDPOINT}/{project_id}") + return delete(self._session, endpoint, self._token, args=kwargs) + + def get_collaborators(self, project_id: str) -> List[Collaborator]: + endpoint = get_rest_url( + f"{PROJECTS_ENDPOINT}/{project_id}/{COLLABORATORS_ENDPOINT}" + ) + collaborators = get(self._session, endpoint, self._token) + return [Collaborator.from_dict(obj) for obj in collaborators] + + def get_section(self, section_id: str) -> Section: + endpoint = get_rest_url(f"{SECTIONS_ENDPOINT}/{section_id}") + section = get(self._session, endpoint, self._token) + return Section.from_dict(section) + + def get_sections(self, **kwargs) -> List[Section]: + endpoint = get_rest_url(SECTIONS_ENDPOINT) + sections = get(self._session, endpoint, self._token, kwargs) + return [Section.from_dict(obj) for obj in sections] + + def add_section(self, name: str, project_id: str, **kwargs) -> Section: + endpoint = get_rest_url(SECTIONS_ENDPOINT) + data = {"name": name, "project_id": project_id} + data.update(kwargs) + section = post(self._session, endpoint, self._token, data=data) + return Section.from_dict(section) + + def update_section(self, section_id: str, name: str, **kwargs) -> bool: + endpoint = get_rest_url(f"{SECTIONS_ENDPOINT}/{section_id}") + data: Dict[str, Any] = {"name": name} + data.update(kwargs) + return post(self._session, endpoint, self._token, data=data) + + def delete_section(self, section_id: str, **kwargs) -> bool: + endpoint = get_rest_url(f"{SECTIONS_ENDPOINT}/{section_id}") + return delete(self._session, endpoint, self._token, args=kwargs) + + def get_comment(self, comment_id: str) -> Comment: + endpoint = get_rest_url(f"{COMMENTS_ENDPOINT}/{comment_id}") + comment = get(self._session, endpoint, self._token) + return Comment.from_dict(comment) + + def get_comments(self, **kwargs) -> List[Comment]: + endpoint = get_rest_url(COMMENTS_ENDPOINT) + comments = get(self._session, endpoint, self._token, kwargs) + return [Comment.from_dict(obj) for obj in comments] + + def add_comment(self, content: str, **kwargs) -> Comment: + endpoint = get_rest_url(COMMENTS_ENDPOINT) + data = {"content": content} + data.update(kwargs) + comment = post(self._session, endpoint, self._token, data=data) + return Comment.from_dict(comment) + + def update_comment(self, comment_id: str, content: str, **kwargs) -> bool: + endpoint = get_rest_url(f"{COMMENTS_ENDPOINT}/{comment_id}") + data: Dict[str, Any] = {"content": content} + data.update(kwargs) + return post(self._session, endpoint, self._token, data=data) + + def delete_comment(self, comment_id: str, **kwargs) -> bool: + endpoint = get_rest_url(f"{COMMENTS_ENDPOINT}/{comment_id}") + return delete(self._session, endpoint, self._token, args=kwargs) + + def get_label(self, label_id: str) -> Label: + endpoint = get_rest_url(f"{LABELS_ENDPOINT}/{label_id}") + label = get(self._session, endpoint, self._token) + return Label.from_dict(label) + + def get_labels(self) -> List[Label]: + endpoint = get_rest_url(LABELS_ENDPOINT) + labels = get(self._session, endpoint, self._token) + return [Label.from_dict(obj) for obj in labels] + + def add_label(self, name: str, **kwargs) -> Label: + endpoint = get_rest_url(LABELS_ENDPOINT) + data = {"name": name} + data.update(kwargs) + label = post(self._session, endpoint, self._token, data=data) + return Label.from_dict(label) + + def update_label(self, label_id: str, **kwargs) -> bool: + endpoint = get_rest_url(f"{LABELS_ENDPOINT}/{label_id}") + return post(self._session, endpoint, self._token, data=kwargs) + + def delete_label(self, label_id: str, **kwargs) -> bool: + endpoint = get_rest_url(f"{LABELS_ENDPOINT}/{label_id}") + return delete(self._session, endpoint, self._token, args=kwargs) + + def get_shared_labels(self) -> List[str]: + endpoint = get_rest_url(SHARED_LABELS_ENDPOINT) + return get(self._session, endpoint, self._token) + + def rename_shared_label(self, name: str, new_name: str) -> bool: + endpoint = get_rest_url(SHARED_LABELS_RENAME_ENDPOINT) + data = {"name": name, "new_name": new_name} + return post(self._session, endpoint, self._token, data=data) + + def remove_shared_label(self, name: str) -> bool: + endpoint = get_rest_url(SHARED_LABELS_REMOVE_ENDPOINT) + data = {"name": name} + return post(self._session, endpoint, self._token, data=data) diff --git a/todoist_project/models/todoist_api_python/api_async.py b/todoist_project/models/todoist_api_python/api_async.py new file mode 100644 index 000000000..23260dbf2 --- /dev/null +++ b/todoist_project/models/todoist_api_python/api_async.py @@ -0,0 +1,122 @@ +from __future__ import annotations + +from typing import List + +from ..todoist_api_python.api import TodoistAPI +from ..todoist_api_python.models import ( + Collaborator, + Comment, + Label, + Project, + QuickAddResult, + Section, + Task, +) +from ..todoist_api_python.utils import run_async + + +class TodoistAPIAsync: + def __init__(self, token: str) -> None: + self._api = TodoistAPI(token) + + async def get_task(self, task_id: str) -> Task: + return await run_async(lambda: self._api.get_task(task_id)) + + async def get_tasks(self, **kwargs) -> List[Task]: + return await run_async(lambda: self._api.get_tasks(**kwargs)) + + async def add_task(self, content: str, **kwargs) -> Task: + return await run_async(lambda: self._api.add_task(content, **kwargs)) + + async def update_task(self, task_id: str, **kwargs) -> bool: + return await run_async(lambda: self._api.update_task(task_id, **kwargs)) + + async def close_task(self, task_id: str, **kwargs) -> bool: + return await run_async(lambda: self._api.close_task(task_id, **kwargs)) + + async def reopen_task(self, task_id: str, **kwargs) -> bool: + return await run_async(lambda: self._api.reopen_task(task_id, **kwargs)) + + async def delete_task(self, task_id: str, **kwargs) -> bool: + return await run_async(lambda: self._api.delete_task(task_id, **kwargs)) + + async def quick_add_task(self, text: str) -> QuickAddResult: + return await run_async(lambda: self._api.quick_add_task(text)) + + async def get_project(self, project_id: str) -> Project: + return await run_async(lambda: self._api.get_project(project_id)) + + async def get_projects(self) -> List[Project]: + return await run_async(lambda: self._api.get_projects()) + + async def add_project(self, name: str, **kwargs) -> Project: + return await run_async(lambda: self._api.add_project(name, **kwargs)) + + async def update_project(self, project_id: str, **kwargs) -> bool: + return await run_async(lambda: self._api.update_project(project_id, **kwargs)) + + async def delete_project(self, project_id: str, **kwargs) -> bool: + return await run_async(lambda: self._api.delete_project(project_id, **kwargs)) + + async def get_collaborators(self, project_id: str) -> List[Collaborator]: + return await run_async(lambda: self._api.get_collaborators(project_id)) + + async def get_section(self, section_id: str) -> Section: + return await run_async(lambda: self._api.get_section(section_id)) + + async def get_sections(self, **kwargs) -> List[Section]: + return await run_async(lambda: self._api.get_sections(**kwargs)) + + async def add_section(self, name: str, project_id: str, **kwargs) -> Section: + return await run_async( + lambda: self._api.add_section(name, project_id, **kwargs) + ) + + async def update_section(self, section_id: str, name: str, **kwargs) -> bool: + return await run_async( + lambda: self._api.update_section(section_id, name, **kwargs) + ) + + async def delete_section(self, section_id: str, **kwargs) -> bool: + return await run_async(lambda: self._api.delete_section(section_id, **kwargs)) + + async def get_comment(self, comment_id: str) -> Comment: + return await run_async(lambda: self._api.get_comment(comment_id)) + + async def get_comments(self, **kwargs) -> List[Comment]: + return await run_async(lambda: self._api.get_comments(**kwargs)) + + async def add_comment(self, content: str, **kwargs) -> Comment: + return await run_async(lambda: self._api.add_comment(content, **kwargs)) + + async def update_comment(self, comment_id: str, content: str, **kwargs) -> bool: + return await run_async( + lambda: self._api.update_comment(comment_id, content, **kwargs) + ) + + async def delete_comment(self, comment_id: str, **kwargs) -> bool: + return await run_async(lambda: self._api.delete_comment(comment_id, **kwargs)) + + async def get_label(self, label_id: str) -> Label: + return await run_async(lambda: self._api.get_label(label_id)) + + async def get_labels(self) -> List[Label]: + return await run_async(lambda: self._api.get_labels()) + + async def add_label(self, name: str, **kwargs) -> Label: + return await run_async(lambda: self._api.add_label(name, **kwargs)) + + async def update_label(self, label_id: str, **kwargs) -> bool: + return await run_async(lambda: self._api.update_label(label_id, **kwargs)) + + async def delete_label(self, label_id: str, **kwargs) -> bool: + return await run_async(lambda: self._api.delete_label(label_id, **kwargs)) + + async def get_shared_labels(self) -> List[str]: + return await run_async(lambda: self._api.get_shared_labels()) + + async def rename_shared_label(self, name: str, new_name: str) -> bool: + return await run_async(lambda: self._api.rename_shared_label(name, new_name)) + + async def remove_shared_label(self, name: str) -> bool: + return await run_async(lambda: self._api.remove_shared_label(name)) diff --git a/todoist_project/models/todoist_api_python/authentication.py b/todoist_project/models/todoist_api_python/authentication.py new file mode 100644 index 000000000..c842fb5ed --- /dev/null +++ b/todoist_project/models/todoist_api_python/authentication.py @@ -0,0 +1,67 @@ +from __future__ import annotations + +from typing import List +from urllib.parse import urlencode + +import requests +from requests import Session + +from ..todoist_api_python.endpoints import ( + AUTHORIZE_ENDPOINT, + REVOKE_TOKEN_ENDPOINT, + TOKEN_ENDPOINT, + get_auth_url, + get_sync_url, +) +from ..todoist_api_python.http_requests import post +from ..todoist_api_python.models import AuthResult +from ..todoist_api_python.utils import run_async + + +def get_auth_token( + client_id: str, client_secret: str, code: str, session: Session | None = None +) -> AuthResult: + endpoint = get_auth_url(TOKEN_ENDPOINT) + session = session or requests.Session() + payload = {"client_id": client_id, "client_secret": client_secret, "code": code} + response = post(session=session, url=endpoint, data=payload) + + return AuthResult.from_dict(response) + + +async def get_auth_token_async( + client_id: str, client_secret: str, code: str +) -> AuthResult: + return await run_async(lambda: get_auth_token(client_id, client_secret, code)) + + +def revoke_auth_token( + client_id: str, client_secret: str, token: str, session: Session | None = None +) -> bool: + endpoint = get_sync_url(REVOKE_TOKEN_ENDPOINT) + session = session or requests.Session() + payload = { + "client_id": client_id, + "client_secret": client_secret, + "access_token": token, + } + response = post(session=session, url=endpoint, data=payload) + + return response + + +async def revoke_auth_token_async( + client_id: str, client_secret: str, token: str +) -> bool: + return await run_async(lambda: revoke_auth_token(client_id, client_secret, token)) + + +def get_authentication_url(client_id: str, scopes: List[str], state: str) -> str: + if len(scopes) == 0: + raise Exception("At least one authorization scope should be requested.") + + query = {"client_id": client_id, "scope": ",".join(scopes), "state": state} + + auth_url = get_auth_url(AUTHORIZE_ENDPOINT) + + return f"{auth_url}?{urlencode(query)}" diff --git a/todoist_project/models/todoist_api_python/endpoints.py b/todoist_project/models/todoist_api_python/endpoints.py new file mode 100644 index 000000000..e5a32be61 --- /dev/null +++ b/todoist_project/models/todoist_api_python/endpoints.py @@ -0,0 +1,37 @@ +from urllib.parse import urljoin + +BASE_URL = "https://api.todoist.com" +AUTH_BASE_URL = "https://todoist.com" +SYNC_VERSION = "v9" +REST_VERSION = "v2" + +SYNC_API = urljoin(BASE_URL, f"/sync/{SYNC_VERSION}/") +REST_API = urljoin(BASE_URL, f"/rest/{REST_VERSION}/") + + +TASKS_ENDPOINT = "tasks" +PROJECTS_ENDPOINT = "projects" +COLLABORATORS_ENDPOINT = "collaborators" +SECTIONS_ENDPOINT = "sections" +COMMENTS_ENDPOINT = "comments" +LABELS_ENDPOINT = "labels" +SHARED_LABELS_ENDPOINT = "labels/shared" +SHARED_LABELS_RENAME_ENDPOINT = f"{SHARED_LABELS_ENDPOINT}/rename" +SHARED_LABELS_REMOVE_ENDPOINT = f"{SHARED_LABELS_ENDPOINT}/remove" +QUICK_ADD_ENDPOINT = "quick/add" + +AUTHORIZE_ENDPOINT = "oauth/authorize" +TOKEN_ENDPOINT = "oauth/access_token" +REVOKE_TOKEN_ENDPOINT = "access_tokens/revoke" + + +def get_rest_url(relative_path: str) -> str: + return urljoin(REST_API, relative_path) + + +def get_sync_url(relative_path: str) -> str: + return urljoin(SYNC_API, relative_path) + + +def get_auth_url(relative_path: str) -> str: + return urljoin(AUTH_BASE_URL, relative_path) diff --git a/todoist_project/models/todoist_api_python/headers.py b/todoist_project/models/todoist_api_python/headers.py new file mode 100644 index 000000000..b735eb6bc --- /dev/null +++ b/todoist_project/models/todoist_api_python/headers.py @@ -0,0 +1,24 @@ +from __future__ import annotations + +from typing import Dict + +CONTENT_TYPE = ("Content-Type", "application/json; charset=utf-8") +AUTHORIZATION = ("Authorization", "Bearer %s") +X_REQUEST_ID = ("X-Request-Id", "%s") + + +def create_headers( + token: str | None = None, + with_content: bool = False, + request_id: str | None = None, +) -> Dict[str, str]: + headers: Dict[str, str] = {} + + if token: + headers.update([(AUTHORIZATION[0], AUTHORIZATION[1] % token)]) + if with_content: + headers.update([CONTENT_TYPE]) + if request_id: + headers.update([(X_REQUEST_ID[0], X_REQUEST_ID[1] % request_id)]) + + return headers diff --git a/todoist_project/models/todoist_api_python/http_requests.py b/todoist_project/models/todoist_api_python/http_requests.py new file mode 100644 index 000000000..bd9b68df9 --- /dev/null +++ b/todoist_project/models/todoist_api_python/http_requests.py @@ -0,0 +1,67 @@ +from __future__ import annotations + +import json +from typing import Any, Dict + +from requests import Session + +from ..todoist_api_python.headers import create_headers + + +def get( + session: Session, + url: str, + token: str | None = None, + params: Dict[str, Any] | None = None, +): + response = session.get(url, params=params, headers=create_headers(token=token)) + + if response.status_code == 200: + return response.json() + + response.raise_for_status() + return response.ok + + +def post( + session: Session, + url: str, + token: str | None = None, + data: Dict[str, Any] | None = None, +): + request_id = data.pop("request_id", None) if data else None + + headers = create_headers( + token=token, with_content=True if data else False, request_id=request_id + ) + + response = session.post( + url, + headers=headers, + data=json.dumps(data) if data else None, + ) + + if response.status_code == 200: + return response.json() + + response.raise_for_status() + return response.ok + + +def delete( + session: Session, + url: str, + token: str | None = None, + args: Dict[str, Any] | None = None, +): + request_id = args.pop("request_id", None) if args else None + + headers = create_headers(token=token, request_id=request_id) + + response = session.delete( + url, + headers=headers, + ) + + response.raise_for_status() + return response.ok diff --git a/todoist_project/models/todoist_api_python/models.py b/todoist_project/models/todoist_api_python/models.py new file mode 100644 index 000000000..f12231296 --- /dev/null +++ b/todoist_project/models/todoist_api_python/models.py @@ -0,0 +1,360 @@ +from __future__ import annotations + +from typing import List, Literal + +import attr + +from ..todoist_api_python.utils import get_url_for_task + +VIEW_STYLE = Literal["list", "board"] + + +@attr.s +class Project(object): + color: str = attr.ib() + comment_count: int = attr.ib() + id: str = attr.ib() + is_favorite: bool = attr.ib() + is_inbox_project: bool = attr.ib() + is_shared: bool = attr.ib() + is_team_inbox: bool = attr.ib() + name: str = attr.ib() + order: int = attr.ib() + parent_id: str | None = attr.ib() + url: str = attr.ib() + view_style: VIEW_STYLE = attr.ib() + + @classmethod + def from_dict(cls, obj): + return cls( + color=obj["color"], + comment_count=obj["comment_count"], + id=obj["id"], + is_favorite=obj["is_favorite"], + is_inbox_project=obj.get("is_inbox_project"), + is_shared=obj["is_shared"], + is_team_inbox=obj.get("is_team_inbox"), + name=obj["name"], + order=obj.get("order"), + parent_id=obj.get("parent_id"), + url=obj["url"], + view_style=obj["view_style"], + ) + + +@attr.s +class Section(object): + id: str = attr.ib() + name: str = attr.ib() + order: int = attr.ib() + project_id: str = attr.ib() + + @classmethod + def from_dict(cls, obj): + return cls( + id=obj["id"], + name=obj["name"], + order=obj["order"], + project_id=obj["project_id"], + ) + + +@attr.s +class Due(object): + date: str = attr.ib() + is_recurring: bool = attr.ib() + string: str = attr.ib() + + datetime: str | None = attr.ib(default=None) + timezone: str | None = attr.ib(default=None) + + @classmethod + def from_dict(cls, obj): + return cls( + date=obj["date"], + is_recurring=obj["is_recurring"], + string=obj["string"], + datetime=obj.get("datetime"), + timezone=obj.get("timezone"), + ) + + def to_dict(self): + return { + "date": self.date, + "is_recurring": self.is_recurring, + "string": self.string, + "datetime": self.datetime, + "timezone": self.timezone, + } + + @classmethod + def from_quick_add_response(cls, obj): + due = obj.get("due") + + if not due: + return None + + timezone = due.get("timezone") + + datetime: str | None = None + + if timezone: + datetime = due["date"] + + return cls( + date=due["date"], + is_recurring=due["is_recurring"], + string=due["string"], + datetime=datetime, + timezone=timezone, + ) + + +@attr.s +class Task(object): + assignee_id: str | None = attr.ib() + assigner_id: str | None = attr.ib() + comment_count: int = attr.ib() + is_completed: bool = attr.ib() + content: str = attr.ib() + created_at: str = attr.ib() + creator_id: str = attr.ib() + description: str = attr.ib() + due: Due | None = attr.ib() + id: str = attr.ib() + labels: List[str] = attr.ib() + order: int = attr.ib() + parent_id: str | None = attr.ib() + priority: int = attr.ib() + project_id: str = attr.ib() + section_id: str | None = attr.ib() + url: str = attr.ib() + + sync_id: str | None = attr.ib(default=None) + + @classmethod + def from_dict(cls, obj): + due: Due | None = None + + if obj.get("due"): + due = Due.from_dict(obj["due"]) + + return cls( + assignee_id=obj.get("assignee_id"), + assigner_id=obj.get("assigner_id"), + comment_count=obj["comment_count"], + is_completed=obj["is_completed"], + content=obj["content"], + created_at=obj["created_at"], + creator_id=obj["creator_id"], + description=obj["description"], + due=due, + id=obj["id"], + labels=obj.get("labels"), + order=obj.get("order"), + parent_id=obj.get("parent_id"), + priority=obj["priority"], + project_id=obj["project_id"], + section_id=obj["section_id"], + url=obj["url"], + ) + + def to_dict(self): + due: dict | None = None + + if self.due: + due = self.due.to_dict() + + return { + "assignee_id": self.assignee_id, + "assigner_id": self.assigner_id, + "comment_count": self.comment_count, + "is_completed": self.is_completed, + "content": self.content, + "created_at": self.created_at, + "creator_id": self.creator_id, + "description": self.description, + "due": due, + "id": self.id, + "labels": self.labels, + "order": self.order, + "parent_id": self.parent_id, + "priority": self.priority, + "project_id": self.project_id, + "section_id": self.section_id, + "sync_id": self.sync_id, + "url": self.url, + } + + @classmethod + def from_quick_add_response(cls, obj): + due: Due | None = None + + if obj.get("due"): + due = Due.from_quick_add_response(obj) + + return cls( + assignee_id=obj.get("responsible_uid"), + assigner_id=obj.get("assigned_by_uid"), + comment_count=0, + is_completed=False, + content=obj["content"], + created_at=obj["added_at"], + creator_id=obj["added_by_uid"], + description=obj["description"], + due=due, + id=obj["id"], + labels=obj["labels"], + order=obj["child_order"], + parent_id=obj["parent_id"] or None, + priority=obj["priority"], + project_id=obj["project_id"], + section_id=obj["section_id"] or None, + sync_id=obj["sync_id"], + url=get_url_for_task(obj["id"], obj["sync_id"]), + ) + + +@attr.s +class QuickAddResult: + task: Task = attr.ib() + + resolved_project_name: str | None = attr.ib(default=None) + resolved_assignee_name: str | None = attr.ib(default=None) + resolved_label_names: List[str] | None = attr.ib(default=None) + resolved_section_name: str | None = attr.ib(default=None) + + @classmethod + def from_quick_add_response(cls, obj): + project_data = obj["meta"].get("project", {}) + assignee_data = obj["meta"].get("assignee", {}) + section_data = obj["meta"].get("section", {}) + + resolved_project_name = None + resolved_assignee_name = None + resolved_section_name = None + + if project_data and len(project_data) == 2: + resolved_project_name = obj["meta"]["project"][1] + + if assignee_data and len(assignee_data) == 2: + resolved_assignee_name = obj["meta"]["assignee"][1] + + if section_data and len(section_data) == 2: + resolved_section_name = obj["meta"]["section"][1] + + return cls( + task=Task.from_quick_add_response(obj), + resolved_project_name=resolved_project_name, + resolved_assignee_name=resolved_assignee_name, + resolved_label_names=list(obj["meta"]["labels"].values()), + resolved_section_name=resolved_section_name, + ) + + +@attr.s +class Collaborator(object): + id: str = attr.ib() + email: str = attr.ib() + name: str = attr.ib() + + @classmethod + def from_dict(cls, obj): + return cls( + id=obj["id"], + email=obj["email"], + name=obj["name"], + ) + + +@attr.s +class Attachment(object): + resource_type: str | None = attr.ib(default=None) + + file_name: str | None = attr.ib(default=None) + file_size: int | None = attr.ib(default=None) + file_type: str | None = attr.ib(default=None) + file_url: str | None = attr.ib(default=None) + file_duration: int | None = attr.ib(default=None) + upload_state: str | None = attr.ib(default=None) + + image: str | None = attr.ib(default=None) + image_width: int | None = attr.ib(default=None) + image_height: int | None = attr.ib(default=None) + + url: str | None = attr.ib(default=None) + title: str | None = attr.ib(default=None) + + @classmethod + def from_dict(cls, obj): + return cls( + resource_type=obj.get("resource_type"), + file_name=obj.get("file_name"), + file_size=obj.get("file_size"), + file_type=obj.get("file_type"), + file_url=obj.get("file_url"), + upload_state=obj.get("upload_state"), + image=obj.get("image"), + image_width=obj.get("image_width"), + image_height=obj.get("image_height"), + url=obj.get("url"), + title=obj.get("title"), + ) + + +@attr.s +class Comment(object): + attachment: Attachment | None = attr.ib() + content: str = attr.ib() + id: str = attr.ib() + posted_at: str = attr.ib() + project_id: str | None = attr.ib() + task_id: str | None = attr.ib() + + @classmethod + def from_dict(cls, obj): + attachment: Attachment | None = None + + if "attachment" in obj and obj["attachment"] is not None: + attachment = Attachment.from_dict(obj["attachment"]) + + return cls( + attachment=attachment, + content=obj["content"], + id=obj["id"], + posted_at=obj["posted_at"], + project_id=obj.get("project_id"), + task_id=obj.get("task_id"), + ) + + +@attr.s +class Label: + id: str = attr.ib() + name: str = attr.ib() + color: str = attr.ib() + order: int = attr.ib() + is_favorite: bool = attr.ib() + + @classmethod + def from_dict(cls, obj): + return cls( + id=obj["id"], + name=obj["name"], + color=obj["color"], + order=obj["order"], + is_favorite=obj["is_favorite"], + ) + + +@attr.s +class AuthResult: + access_token: str = attr.ib() + state: str = attr.ib() + + @classmethod + def from_dict(cls, obj): + return cls( + access_token=obj["access_token"], + state=obj["state"], + ) diff --git a/todoist_project/models/todoist_api_python/py.typed b/todoist_project/models/todoist_api_python/py.typed new file mode 100644 index 000000000..e69de29bb diff --git a/todoist_project/models/todoist_api_python/utils.py b/todoist_project/models/todoist_api_python/utils.py new file mode 100644 index 000000000..94030127c --- /dev/null +++ b/todoist_project/models/todoist_api_python/utils.py @@ -0,0 +1,18 @@ +from __future__ import annotations + +import asyncio + +SHOW_TASK_ENDPOINT = "https://todoist.com/showTask" + + +def get_url_for_task(task_id: int, sync_id: int | None) -> str: + return ( + f"{SHOW_TASK_ENDPOINT}?id={task_id}&sync_id={sync_id}" + if sync_id + else f"{SHOW_TASK_ENDPOINT}?id={task_id}" + ) + + +async def run_async(func): + loop = asyncio.get_event_loop() + return await loop.run_in_executor(None, func) diff --git a/todoist_project/static/description/assets/icons/check.png b/todoist_project/static/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/todoist_project/static/description/assets/icons/check.png differ diff --git a/todoist_project/static/description/assets/icons/chevron.png b/todoist_project/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/todoist_project/static/description/assets/icons/chevron.png differ diff --git a/todoist_project/static/description/assets/icons/cogs.png b/todoist_project/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/todoist_project/static/description/assets/icons/cogs.png differ diff --git a/todoist_project/static/description/assets/icons/consultation.png b/todoist_project/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/todoist_project/static/description/assets/icons/consultation.png differ diff --git a/todoist_project/static/description/assets/icons/ecom-black.png b/todoist_project/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/todoist_project/static/description/assets/icons/ecom-black.png differ diff --git a/todoist_project/static/description/assets/icons/education-black.png b/todoist_project/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/todoist_project/static/description/assets/icons/education-black.png differ diff --git a/todoist_project/static/description/assets/icons/hotel-black.png b/todoist_project/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/todoist_project/static/description/assets/icons/hotel-black.png differ diff --git a/todoist_project/static/description/assets/icons/license.png b/todoist_project/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/todoist_project/static/description/assets/icons/license.png differ diff --git a/todoist_project/static/description/assets/icons/lifebuoy.png b/todoist_project/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/todoist_project/static/description/assets/icons/lifebuoy.png differ diff --git a/todoist_project/static/description/assets/icons/manufacturing-black.png b/todoist_project/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/todoist_project/static/description/assets/icons/manufacturing-black.png differ diff --git a/todoist_project/static/description/assets/icons/pos-black.png b/todoist_project/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/todoist_project/static/description/assets/icons/pos-black.png differ diff --git a/todoist_project/static/description/assets/icons/puzzle.png b/todoist_project/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/todoist_project/static/description/assets/icons/puzzle.png differ diff --git a/todoist_project/static/description/assets/icons/restaurant-black.png b/todoist_project/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/todoist_project/static/description/assets/icons/restaurant-black.png differ diff --git a/todoist_project/static/description/assets/icons/service-black.png b/todoist_project/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/todoist_project/static/description/assets/icons/service-black.png differ diff --git a/todoist_project/static/description/assets/icons/trading-black.png b/todoist_project/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/todoist_project/static/description/assets/icons/trading-black.png differ diff --git a/todoist_project/static/description/assets/icons/training.png b/todoist_project/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/todoist_project/static/description/assets/icons/training.png differ diff --git a/todoist_project/static/description/assets/icons/update.png b/todoist_project/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/todoist_project/static/description/assets/icons/update.png differ diff --git a/todoist_project/static/description/assets/icons/user.png b/todoist_project/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/todoist_project/static/description/assets/icons/user.png differ diff --git a/todoist_project/static/description/assets/icons/wrench.png b/todoist_project/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/todoist_project/static/description/assets/icons/wrench.png differ diff --git a/todoist_project/static/description/assets/misc/categories.png b/todoist_project/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/todoist_project/static/description/assets/misc/categories.png differ diff --git a/todoist_project/static/description/assets/misc/check-box.png b/todoist_project/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/todoist_project/static/description/assets/misc/check-box.png differ diff --git a/todoist_project/static/description/assets/misc/compass.png b/todoist_project/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/todoist_project/static/description/assets/misc/compass.png differ diff --git a/todoist_project/static/description/assets/misc/corporate.png b/todoist_project/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/todoist_project/static/description/assets/misc/corporate.png differ diff --git a/todoist_project/static/description/assets/misc/customer-support.png b/todoist_project/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/todoist_project/static/description/assets/misc/customer-support.png differ diff --git a/todoist_project/static/description/assets/misc/cybrosys-logo.png b/todoist_project/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/todoist_project/static/description/assets/misc/cybrosys-logo.png differ diff --git a/todoist_project/static/description/assets/misc/features.png b/todoist_project/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/todoist_project/static/description/assets/misc/features.png differ diff --git a/todoist_project/static/description/assets/misc/logo.png b/todoist_project/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/todoist_project/static/description/assets/misc/logo.png differ diff --git a/todoist_project/static/description/assets/misc/pictures.png b/todoist_project/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/todoist_project/static/description/assets/misc/pictures.png differ diff --git a/todoist_project/static/description/assets/misc/pie-chart.png b/todoist_project/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/todoist_project/static/description/assets/misc/pie-chart.png differ diff --git a/todoist_project/static/description/assets/misc/right-arrow.png b/todoist_project/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/todoist_project/static/description/assets/misc/right-arrow.png differ diff --git a/todoist_project/static/description/assets/misc/star.png b/todoist_project/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/todoist_project/static/description/assets/misc/star.png differ diff --git a/todoist_project/static/description/assets/misc/support.png b/todoist_project/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/todoist_project/static/description/assets/misc/support.png differ diff --git a/todoist_project/static/description/assets/misc/whatsapp.png b/todoist_project/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/todoist_project/static/description/assets/misc/whatsapp.png differ diff --git a/todoist_project/static/description/assets/modules/11.png b/todoist_project/static/description/assets/modules/11.png new file mode 100644 index 000000000..eb3f8652f Binary files /dev/null and b/todoist_project/static/description/assets/modules/11.png differ diff --git a/todoist_project/static/description/assets/modules/12.png b/todoist_project/static/description/assets/modules/12.png new file mode 100644 index 000000000..3415917c2 Binary files /dev/null and b/todoist_project/static/description/assets/modules/12.png differ diff --git a/todoist_project/static/description/assets/modules/13.png b/todoist_project/static/description/assets/modules/13.png new file mode 100644 index 000000000..7a9d3b1f6 Binary files /dev/null and b/todoist_project/static/description/assets/modules/13.png differ diff --git a/todoist_project/static/description/assets/modules/14.png b/todoist_project/static/description/assets/modules/14.png new file mode 100644 index 000000000..c6a41b7ec Binary files /dev/null and b/todoist_project/static/description/assets/modules/14.png differ diff --git a/todoist_project/static/description/assets/modules/15.png b/todoist_project/static/description/assets/modules/15.png new file mode 100644 index 000000000..33a2b2e25 Binary files /dev/null and b/todoist_project/static/description/assets/modules/15.png differ diff --git a/todoist_project/static/description/assets/modules/16.png b/todoist_project/static/description/assets/modules/16.png new file mode 100644 index 000000000..0d814d2db Binary files /dev/null and b/todoist_project/static/description/assets/modules/16.png differ diff --git a/todoist_project/static/description/assets/screenshots/1.0.png b/todoist_project/static/description/assets/screenshots/1.0.png new file mode 100644 index 000000000..90a22c583 Binary files /dev/null and b/todoist_project/static/description/assets/screenshots/1.0.png differ diff --git a/todoist_project/static/description/assets/screenshots/1.png b/todoist_project/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..d435dfac5 Binary files /dev/null and b/todoist_project/static/description/assets/screenshots/1.png differ diff --git a/todoist_project/static/description/assets/screenshots/2.png b/todoist_project/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..f5e7d7764 Binary files /dev/null and b/todoist_project/static/description/assets/screenshots/2.png differ diff --git a/todoist_project/static/description/assets/screenshots/3.png b/todoist_project/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..907516d49 Binary files /dev/null and b/todoist_project/static/description/assets/screenshots/3.png differ diff --git a/todoist_project/static/description/assets/screenshots/hero.gif b/todoist_project/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..6e217d333 Binary files /dev/null and b/todoist_project/static/description/assets/screenshots/hero.gif differ diff --git a/todoist_project/static/description/assets/screenshots/picture_5.png b/todoist_project/static/description/assets/screenshots/picture_5.png new file mode 100644 index 000000000..0ef98267e Binary files /dev/null and b/todoist_project/static/description/assets/screenshots/picture_5.png differ diff --git a/todoist_project/static/description/banner.png b/todoist_project/static/description/banner.png new file mode 100644 index 000000000..9d3ea0221 Binary files /dev/null and b/todoist_project/static/description/banner.png differ diff --git a/todoist_project/static/description/icon.png b/todoist_project/static/description/icon.png new file mode 100644 index 000000000..87146c23c Binary files /dev/null and b/todoist_project/static/description/icon.png differ diff --git a/todoist_project/static/description/index.html b/todoist_project/static/description/index.html new file mode 100644 index 000000000..ebc610d6d --- /dev/null +++ b/todoist_project/static/description/index.html @@ -0,0 +1,655 @@ +
+ +
+ +
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+
+
+
+

+ Todoist Integration

+

+ This module enables the connection of Todoist with Odoo. +

+ +
+
+
+
+ +
+
+ +
+

+ Explore This + Module

+
+ +
+
+ +
+

+ Overview +

+
+ +
+
+

+ This module enables the integration of Todoist and Odoo. + Projects and tasks from Todoist to Odoo will be managed in this + way.

+
+
+ +
+
+ +
+

+ Features +

+
+
+
+
+ +

+ Sync projects and tasks directly from Todoist.

+
+
+
+ +
+
+ +
+

+ Screenshots +

+
+ +
+
+
+

+ Todoist App View.

+ + +
+ +
+

+ User can copy the token from integration and paste in odoo to + complete the authentication.

+ + +
+ + +
+

+ Take Preference form and paste the Token from Todoist App and + use the sync button to take the projects + and tasks from Todoist App to Odoo Project Module.

+ + +
+
+

+ Project View.

+ +
+
+

+ Task Form View.

+ +
+
+ +
+
+ +
+

+ Related + Products +

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

+ Our Services +

+
+ +
+
+
+
+ +
+
+ Odoo + Customization
+
+ +
+
+ +
+
+ Odoo + Implementation
+
+ +
+
+ +
+
+ Odoo + Support
+
+ + +
+
+ +
+
+ Hire + Odoo + Developer
+
+ +
+
+ +
+
+ Odoo + Integration
+
+ +
+
+ +
+
+ Odoo + Migration
+
+ + +
+
+ +
+
+ Odoo + Consultancy
+
+ +
+
+ +
+
+ Odoo + Implementation
+
+ +
+
+ +
+
+ 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 86068 + 27707

+
+
+
+
+
+
+
+ +
+
+
+ +
\ No newline at end of file diff --git a/todoist_project/views/res_users_views.xml b/todoist_project/views/res_users_views.xml new file mode 100644 index 000000000..4c8c29fa9 --- /dev/null +++ b/todoist_project/views/res_users_views.xml @@ -0,0 +1,24 @@ + + + + + res.users.view.form.inherit.todoist.project + res.users + + + +
+
+
+ + + + + +
+
+