-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #479 from itpp-labs/16.0-sync-improvements2
commit is created by 👷♂️ Merge Bot: https://odoo-devops.readthedocs.io/en/latest/git/github-merge-bot.html
- Loading branch information
Showing
20 changed files
with
489 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# License MIT (https://opensource.org/licenses/MIT). | ||
from . import test_telegram |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Copyright 2024 Ivan Yelizariev <https://twitter.com/yelizariev> | ||
# License MIT (https://opensource.org/licenses/MIT). | ||
from odoo.tests.common import TransactionCase | ||
|
||
|
||
class TestResPartnerTelegram(TransactionCase): | ||
def setUp(self): | ||
super(TestResPartnerTelegram, self).setUp() | ||
self.ResPartner = self.env["res.partner"] | ||
# Create a partner without telegram information | ||
self.partner = self.ResPartner.create({"name": "Test"}) | ||
|
||
def test_telegram_set_username(self): | ||
# Set the telegram field with a username | ||
self.partner.telegram = "@testuser" | ||
|
||
# Check the computed fields | ||
self.assertEqual(self.partner.telegram_username, "testuser") | ||
self.assertEqual(self.partner.telegram_url, "https://t.me/testuser") | ||
self.assertEqual(self.partner.telegram, "testuser") | ||
|
||
def test_telegram_set_mobile(self): | ||
# Set the telegram field with a mobile number | ||
self.partner.telegram = "+1234567890" | ||
|
||
# Check the computed fields | ||
self.assertEqual(self.partner.telegram_mobile, "+1234567890") | ||
self.assertEqual(self.partner.telegram_url, "https://t.me/+1234567890") | ||
self.assertEqual(self.partner.telegram, "+1234567890") | ||
|
||
def test_telegram_set_url(self): | ||
# Set the telegram field with a URL | ||
self.partner.telegram = "https://t.me/testuser" | ||
|
||
# Check the computed fields | ||
self.assertEqual(self.partner.telegram_username, "testuser") | ||
self.assertEqual(self.partner.telegram_url, "https://t.me/testuser") | ||
self.assertEqual(self.partner.telegram, "testuser") | ||
|
||
def test_telegram_clear(self): | ||
# Set the telegram field and then clear it | ||
self.partner.telegram = "@testuser" | ||
self.partner.telegram = "" | ||
|
||
# Check the computed fields | ||
self.assertFalse(self.partner.telegram_username) | ||
self.assertFalse(self.partner.telegram_mobile) | ||
self.assertFalse(self.partner.telegram_url) | ||
self.assertFalse(self.partner.telegram) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,13 +7,16 @@ | |
"name": "Sync 🪬 Studio", | ||
"summary": """Join the Amazing 😍 Community ⤵️""", | ||
"category": "VooDoo ✨ Magic", | ||
"version": "16.0.11.0.1", | ||
"version": "16.0.13.0.0", | ||
"application": True, | ||
"author": "Ivan Kropotkin", | ||
"support": "[email protected]", | ||
"website": "https://sync_studio.t.me/", | ||
"license": "Other OSI approved licence", # MIT | ||
"depends": ["base_automation", "mail", "queue_job"], | ||
# The `partner_telegram` dependency is not directly needed, | ||
# but it plays an important role in the **Sync 🪬 Studio** ecosystem | ||
# and is added for the quick onboarding of new **Cyber ✨ Pirates**. | ||
"depends": ["base_automation", "mail", "queue_job", "partner_telegram"], | ||
"external_dependencies": {"python": ["markdown", "pyyaml"], "bin": []}, | ||
"data": [ | ||
"security/sync_groups.xml", | ||
|
@@ -25,6 +28,7 @@ | |
"views/sync_trigger_automation_views.xml", | ||
"views/sync_trigger_webhook_views.xml", | ||
"views/sync_trigger_button_views.xml", | ||
"views/sync_order_views.xml", | ||
"views/sync_task_views.xml", | ||
"views/sync_link_views.xml", | ||
"views/sync_project_views.xml", | ||
|
@@ -37,12 +41,6 @@ | |
}, | ||
"demo": [ | ||
"data/sync_project_unittest_demo.xml", | ||
# Obsolete | ||
# "data/sync_project_context_demo.xml", | ||
# "data/sync_project_telegram_demo.xml", | ||
# "data/sync_project_odoo2odoo_demo.xml", | ||
# "data/sync_project_trello_github_demo.xml", | ||
# "data/sync_project_context_demo.xml", | ||
], | ||
"qweb": [], | ||
"post_load": None, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.