Skip to content

Commit 9f32a4d

Browse files
[18.0][MIG] fetchmail_mail_activity_team_activity: Migration to 18.0
1 parent be22a3b commit 9f32a4d

File tree

9 files changed

+54
-87
lines changed

9 files changed

+54
-87
lines changed
Lines changed: 20 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,33 @@
11
==========================================
2-
Mail Activity Fetchmail with Team Activity
2+
Mail Activity Fetchmail With Team Activity
33
==========================================
44

5-
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
6-
!! This file is generated by oca-gen-addon-readme !!
7-
!! changes will be overwritten. !!
8-
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
9-
10-
.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-red.png
11-
:target: https://odoo-community.org/page/development-status
12-
:alt: Alpha
13-
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
14-
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
15-
:alt: License: AGPL-3
16-
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fsocial-lightgray.png?logo=github
17-
:target: https://github.com/OCA/social/tree/15.0/mail_activity_fetchmail
18-
:alt: OCA/social
19-
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
20-
:target: https://translation.odoo-community.org/projects/social-15-0/social-15-0-mail_activity_fetchmail
21-
:alt: Translate me on Weblate
22-
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
23-
:target: https://runbot.odoo-community.org/runbot/205/15.0
24-
:alt: Try me on Runbot
25-
26-
|badge1| |badge2| |badge3| |badge4| |badge5|
27-
28-
29-
**Table of contents**
30-
31-
.. contents::
32-
:local:
33-
345
Usage
35-
=====
6+
-----
367

378
Uses mail.activity.team to configure automatic activities when mails arrive for the specified models.
389

3910
The configuration to add RMA and PO models (Settings --> Technical --> Activity Teams menu).
4011

41-
Bug Tracker
42-
===========
43-
44-
Bugs are tracked on `GitHub Issues <https://github.com/OCA/social/issues>`_.
45-
In case of trouble, please check there if your issue has already been reported.
46-
If you spotted it first, help us smashing it by providing a detailed and welcomed
47-
`feedback <https://github.com/OCA/social/issues/new?body=module:%20mail_activity_fetchmail%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
48-
49-
Do not contact contributors directly about support or help with technical issues.
50-
51-
Credits
52-
=======
53-
54-
Authors
55-
~~~~~~~
56-
57-
* initOS GmbH
58-
59-
Contributors
60-
~~~~~~~~~~~~
61-
62-
* isufi kapasi (isufi.kapasi@initos.com)
63-
64-
Maintainers
65-
~~~~~~~~~~~
66-
67-
This module is maintained by the OCA.
12+
Testing
13+
-------
6814

69-
.. image:: https://odoo-community.org/logo.png
70-
:alt: Odoo Community Association
71-
:target: https://odoo-community.org
15+
Team Creation:
7216

73-
OCA, or the Odoo Community Association, is a nonprofit organization whose
74-
mission is to support the collaborative development of Odoo features and
75-
promote its widespread use.
17+
1. Go to: "Settings" -> "Technical" -> "Activity" -> "Activity Teams"
18+
2. Select or create a new team via the "+ New" button
19+
3. Fill in the necessary details:
20+
- Name: e.g., ´Team1´
21+
- Team Leader: e.g., ´Person1´
22+
- Used models: e.g., ´Sales Order´ (can be more than one model assigned)
23+
- There has to be at least one "Member" per team ("Team Leader" is counted by default)
24+
4. Press Save
7625

77-
This module is part of the `OCA/social <https://github.com/OCA/social/tree/15.0/mail_activity_fetchmail>`_ project on GitHub.
26+
Testing:
7827

79-
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
28+
1. "Sales" -> "Orders" -> "Quotations" -> "+ New"
29+
2. Fill in the necessary details
30+
3. Send a message via the chat section in the SO
31+
6. Check the recipients email inbox, you should have received an email
32+
7. Reply to it
33+
8. In Odoo you should see the message from the customer and a generated activity
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# © 2022 initOS GmbH
21
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
32

43
from . import models
Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,18 @@
1-
# © 2022 initOS GmbH
21
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
32

43
{
54
"name": "Mail Activity on Fetchmail with Team Activity",
6-
"version": "15.0.1.0.0",
7-
"development_status": "Alpha",
8-
"category": "Hidden",
9-
"author": "initOS GmbH, Odoo Community Association (OCA)",
10-
"website": "https://github.com/OCA/social",
5+
"version": "18.0.1.0.0",
6+
"category": "Social Network",
7+
"author": "Nitrokey GmbH, Odoo Community Association (OCA)",
8+
"website": "https://github.com/OCA/mail",
119
"license": "AGPL-3",
1210
"summary": """
1311
* Uses mail.activity.team to configure automatic activities when mails
1412
arrive for the specified models.
1513
* The configuration to add RMA and PO models
1614
(Settings --> Technical --> Activity Teams menu)
1715
""",
18-
"depends": [
19-
"mail_activity_team",
20-
],
16+
"depends": ["mail_activity_team", "calendar"],
2117
"installable": True,
2218
}

fetchmail_mail_activity_team_activity/i18n/fetchmail_mail_activity_team_activity.pot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Translation of Odoo Server.
22
# This file contains the translation of the following modules:
3-
# * fetchmail_mail_activity_team_activity
3+
# * fetchmail_mail_activity_team_activity
44
#
55
msgid ""
66
msgstr ""
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# © 2022 initOS GmbH
21
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
32

43
from . import mail_thread

fetchmail_mail_activity_team_activity/models/mail_thread.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# © 2022 initOS GmbH
21
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
32

43
from odoo import api, models
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
requires = ["whool"]
3+
build-backend = "whool.buildapi"
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# © 2022 initOS GmbH
21
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
32

43
from . import test_activity

fetchmail_mail_activity_team_activity/tests/test_activity.py

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# © 2022 initOS GmbH
21
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
32

43
import logging
@@ -11,9 +10,13 @@
1110

1211

1312
class TestActivity(TransactionCase):
13+
def setUp(self):
14+
super().setUp()
15+
# Clean up any existing teams before each test
16+
self.env["mail.activity.team"].search([]).unlink()
17+
1418
def generate_reply(self, message):
1519
return (
16-
# "Date: Thu, 22 Sep 2022 12:23:20 +0000",
1720
"From: ext.partner@example.org\r\n"
1821
"To: odoo.test@local\r\n"
1922
f"Message-ID: {uuid.uuid4()}\r\n"
@@ -22,20 +25,35 @@ def generate_reply(self, message):
2225
)
2326

2427
def test_no_team(self):
28+
"""Test that no activity is created when no team exists"""
29+
# Ensure no teams exist
30+
teams = self.env["mail.activity.team"].search([])
31+
self.assertEqual(len(teams), 0, "Should have no teams before test")
32+
2533
thread = self.env.user.partner_id
2634
msg = thread.message_notify(
2735
partner_ids=self.env.user.partner_id.ids,
2836
body="Testing",
2937
)
3038

31-
messages = thread.message_ids
32-
activities = thread.activity_ids
33-
reply = self.generate_reply(msg)
39+
# Record initial state
40+
initial_activities = thread.activity_ids
41+
initial_message_count = len(thread.message_ids)
3442

43+
# Process email reply
44+
reply = self.generate_reply(msg)
3545
thread_id = thread.message_process(thread._name, reply)
36-
self.assertTrue(len(messages) < len(thread.message_ids))
37-
self.assertEqual(activities, thread.activity_ids)
46+
47+
# Assertions
3848
self.assertEqual(thread_id, thread.id)
49+
self.assertTrue(len(thread.message_ids) > initial_message_count)
50+
51+
# CRITICAL: No new activity should be created
52+
self.assertEqual(
53+
thread.activity_ids.ids,
54+
initial_activities.ids,
55+
"No activity should be created when no team exists",
56+
)
3957

4058
def test_with_team(self):
4159
thread = self.env.user.partner_id

0 commit comments

Comments
 (0)