From ea075c18d2356cd32a10869764be59ac7a5ef334 Mon Sep 17 00:00:00 2001 From: sbejaoui Date: Tue, 29 Oct 2019 10:54:33 +0100 Subject: [PATCH 01/11] [12.0][ADD] - add a link between project tasks and calendar events --- calendar_event_link_project_task/README.rst | 73 +++ calendar_event_link_project_task/__init__.py | 2 + .../__manifest__.py | 16 + .../models/__init__.py | 1 + .../models/project_task.py | 9 + .../readme/CONTRIBUTORS.rst | 1 + .../readme/DESCRIPTION.rst | 1 + .../static/description/index.html | 419 ++++++++++++++++++ .../tests/__init__.py | 1 + .../tests/test_calendar_event_link.py | 29 ++ .../views/project_task.xml | 24 + 11 files changed, 576 insertions(+) create mode 100644 calendar_event_link_project_task/README.rst create mode 100644 calendar_event_link_project_task/__init__.py create mode 100644 calendar_event_link_project_task/__manifest__.py create mode 100644 calendar_event_link_project_task/models/__init__.py create mode 100644 calendar_event_link_project_task/models/project_task.py create mode 100644 calendar_event_link_project_task/readme/CONTRIBUTORS.rst create mode 100644 calendar_event_link_project_task/readme/DESCRIPTION.rst create mode 100644 calendar_event_link_project_task/static/description/index.html create mode 100644 calendar_event_link_project_task/tests/__init__.py create mode 100644 calendar_event_link_project_task/tests/test_calendar_event_link.py create mode 100644 calendar_event_link_project_task/views/project_task.xml diff --git a/calendar_event_link_project_task/README.rst b/calendar_event_link_project_task/README.rst new file mode 100644 index 00000000..16378468 --- /dev/null +++ b/calendar_event_link_project_task/README.rst @@ -0,0 +1,73 @@ +=================================== +Calendar Event Link To Project Task +=================================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fcalendar-lightgray.png?logo=github + :target: https://github.com/OCA/calendar/tree/12.0/calendar_event_link_project_task + :alt: OCA/calendar +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/calendar-12-0/calendar-12-0-calendar_event_link_project_task + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/279/12.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module add a link between project tasks and calendar events + +**Table of contents** + +.. contents:: + :local: + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* ACSONE SA/NV + +Contributors +~~~~~~~~~~~~ + +* Souheil Bejaoui + +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +This module is part of the `OCA/calendar `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/calendar_event_link_project_task/__init__.py b/calendar_event_link_project_task/__init__.py new file mode 100644 index 00000000..0ee8b507 --- /dev/null +++ b/calendar_event_link_project_task/__init__.py @@ -0,0 +1,2 @@ +from . import models +from . import tests diff --git a/calendar_event_link_project_task/__manifest__.py b/calendar_event_link_project_task/__manifest__.py new file mode 100644 index 00000000..00f2d9dc --- /dev/null +++ b/calendar_event_link_project_task/__manifest__.py @@ -0,0 +1,16 @@ +# Copyright 2019 ACSONE SA/NV +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Calendar Event Link To Project Task", + "summary": """ + This module add a link between project tasks and calendar events""", + "version": "12.0.1.0.0", + "license": "AGPL-3", + "author": "ACSONE SA/NV," + "Odoo Community Association (OCA)", + "website": "https://github.com/OCA/calendar", + "depends": ["project", "calendar_event_link_base"], + "data": ["views/project_task.xml"], + "demo": [], +} diff --git a/calendar_event_link_project_task/models/__init__.py b/calendar_event_link_project_task/models/__init__.py new file mode 100644 index 00000000..edf2d36b --- /dev/null +++ b/calendar_event_link_project_task/models/__init__.py @@ -0,0 +1 @@ +from . import project_task diff --git a/calendar_event_link_project_task/models/project_task.py b/calendar_event_link_project_task/models/project_task.py new file mode 100644 index 00000000..e995c883 --- /dev/null +++ b/calendar_event_link_project_task/models/project_task.py @@ -0,0 +1,9 @@ +# Copyright 2019 ACSONE SA/NV +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import models + + +class ProjectTask(models.Model): + _name = "project.task" + _inherit = ["project.task", "calendar.event.link.mixin"] diff --git a/calendar_event_link_project_task/readme/CONTRIBUTORS.rst b/calendar_event_link_project_task/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000..50e6298d --- /dev/null +++ b/calendar_event_link_project_task/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +* Souheil Bejaoui diff --git a/calendar_event_link_project_task/readme/DESCRIPTION.rst b/calendar_event_link_project_task/readme/DESCRIPTION.rst new file mode 100644 index 00000000..d3ddf319 --- /dev/null +++ b/calendar_event_link_project_task/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +This module add a link between project tasks and calendar events diff --git a/calendar_event_link_project_task/static/description/index.html b/calendar_event_link_project_task/static/description/index.html new file mode 100644 index 00000000..fed93a5d --- /dev/null +++ b/calendar_event_link_project_task/static/description/index.html @@ -0,0 +1,419 @@ + + + + + + +Calendar Event Link To Project Task + + + + + + diff --git a/calendar_event_link_project_task/tests/__init__.py b/calendar_event_link_project_task/tests/__init__.py new file mode 100644 index 00000000..73f92135 --- /dev/null +++ b/calendar_event_link_project_task/tests/__init__.py @@ -0,0 +1 @@ +from . import test_calendar_event_link diff --git a/calendar_event_link_project_task/tests/test_calendar_event_link.py b/calendar_event_link_project_task/tests/test_calendar_event_link.py new file mode 100644 index 00000000..c3bf2295 --- /dev/null +++ b/calendar_event_link_project_task/tests/test_calendar_event_link.py @@ -0,0 +1,29 @@ +# Copyright 2019 ACSONE SA/NV +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo.tests.common import TransactionCase + + +class TestCalendarEventLink(TransactionCase): + def setUp(self): + super(TestCalendarEventLink, self).setUp() + self.task = self.env["project.task"].search([], limit=1) + + def test_calendar_event_link(self): + calendar_event_link_action = self.task.action_show_events() + event = ( + self.env["calendar.event"] + .with_context(calendar_event_link_action["context"]) + .create( + { + "name": "event", + "start": "2019-10-29 10:00:00", + "stop": "2019-10-29 11:00:00", + } + ) + ) + self.assertEqual(self.task.event_count, 1) + self.assertEqual( + self.env["calendar.event"].search(calendar_event_link_action["domain"]), + event, + ) diff --git a/calendar_event_link_project_task/views/project_task.xml b/calendar_event_link_project_task/views/project_task.xml new file mode 100644 index 00000000..ecb03276 --- /dev/null +++ b/calendar_event_link_project_task/views/project_task.xml @@ -0,0 +1,24 @@ + + + + + + + project.task + + + + + + + + + + From c9717b59367898243945cc4353cd75b09f06c745 Mon Sep 17 00:00:00 2001 From: Bejaoui Souheil Date: Mon, 18 May 2020 20:54:31 +0200 Subject: [PATCH 02/11] [FIX] - Fix indent --- .../views/project_task.xml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/calendar_event_link_project_task/views/project_task.xml b/calendar_event_link_project_task/views/project_task.xml index ecb03276..1c730b7f 100644 --- a/calendar_event_link_project_task/views/project_task.xml +++ b/calendar_event_link_project_task/views/project_task.xml @@ -9,16 +9,15 @@ - + - From 8578d9a21b4273dbd9ee768c34b8b096e1d56038 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Mon, 19 Jul 2021 21:03:21 +0000 Subject: [PATCH 03/11] [UPD] README.rst --- calendar_event_link_project_task/static/description/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/calendar_event_link_project_task/static/description/index.html b/calendar_event_link_project_task/static/description/index.html index fed93a5d..5284913f 100644 --- a/calendar_event_link_project_task/static/description/index.html +++ b/calendar_event_link_project_task/static/description/index.html @@ -3,7 +3,7 @@ - + Calendar Event Link To Project Task