Browse Source

Aug 20 [UPDT] Updated 'odoo_trello_connector'

pull/331/head
AjmalCybro 8 months ago
parent
commit
8992dcfdc7
  1. 8
      odoo_trello_connector/__init__.py
  2. 5
      odoo_trello_connector/__manifest__.py
  3. 6
      odoo_trello_connector/doc/RELEASE_NOTES.md
  4. 2
      odoo_trello_connector/models/project_project.py
  5. 72
      odoo_trello_connector/models/res_users.py
  6. BIN
      odoo_trello_connector/static/description/assets/screenshots/img.png
  7. BIN
      odoo_trello_connector/static/description/assets/screenshots/img_1.png
  8. 153
      odoo_trello_connector/static/description/index.html

8
odoo_trello_connector/__init__.py

@ -20,3 +20,11 @@
#
################################################################################
from . import models
from odoo.exceptions import UserError
def pre_init_hook(env):
dependent_apps = env['ir.module.module'].search([('name', 'in', ['queue_job_cron_jobrunner', 'queue_job'])])
for app in dependent_apps:
if app.state != 'installed':
raise UserError('Please make sure you have added and installed Queue Job and Queue Job Cron Jobrunner in your system')

5
odoo_trello_connector/__manifest__.py

@ -21,7 +21,7 @@
################################################################################
{
'name': "Odoo Trello Connector",
'version': '17.0.1.0.0',
'version': '17.0.1.1.0',
'category': 'Project',
'summary': """Integrate Projects and Tasks between Trello and Odoo""",
'description': """This module helps to import all Projects and Tasks from
@ -40,7 +40,8 @@
],
'images': ['static/description/banner.jpg'],
'license': 'AGPL-3',
'pre_init_hook': 'pre_init_hook',
'installable': True,
'auto_install': False,
'application': False,
'application': False
}

6
odoo_trello_connector/doc/RELEASE_NOTES.md

@ -5,3 +5,9 @@
#### ADD
- Initial commit for Odoo Trello Connector
#### 17.08.2024
#### Version 17.0.1.1.0
#### ADD
- Added Job queue support for project import from trello

2
odoo_trello_connector/models/project_project.py

@ -19,7 +19,7 @@
# If not, see <http://www.gnu.org/licenses/>.
#
################################################################################
from odoo import fields, models
from odoo import api, fields, models
class ProjectProject(models.Model):

72
odoo_trello_connector/models/res_users.py

@ -56,41 +56,44 @@ class ResUsers(models.Model):
"Accept": "application/json"
}
member = self.get_member_id(header, self.user_name)
for board in self.get_boards(header, query,
member):
project = self.env['project.project'].sudo().search(
[('trello_reference', '=', board['id'])])
if not project:
project = self.env['project.project'].sudo().create({
'name': board['name'],
'description': board['desc'],
'trello_reference': board['id']
for board in self.get_boards(header, query, member):
self.with_delay(
channel='root.import_project',
description='Importing Board From Trello', max_retries=10)._delay_import(
board, header, query)
def _delay_import(self, board, header, query):
"""Import will performed within the job queue"""
project = self.env['project.project'].sudo().search(
[('trello_reference', '=', board['id'])])
if not project:
project = self.env['project.project'].sudo().create({
'name': board['name'],
'description': board['desc'],
'trello_reference': board['id']
})
for rec in self.get_list_on_board(header, query, board['id']):
stages = self.env['project.task.type'].search([])
if rec['name'] not in stages.mapped('name'):
self.env['project.task.type'].sudo().create({
'name': rec['name']
})
project.sudo().write(
{'type_ids': [(4, stages.search([(
'name', '=', rec['name'])])[0].id, project.id)]})
for card in self.get_cards(header, query, board['id']):
if card['id'] not in self.env['project.task'].search([]).mapped('trello_reference'):
self.env['project.task'].create({
'name': card['name'],
'project_id': project.id,
'stage_id': self.env[
'project.task.type'].search([('name', '=',
self.get_a_list(
header, query,
card['idList'])[
'name'])])[0].id,
'trello_reference': card['id']
})
for rec in self.get_list_on_board(header, query, board['id']):
stages = self.env[
'project.task.type'].search([])
if rec['name'] not in stages.mapped('name'):
self.env['project.task.type'].sudo().create({
'name': rec['name']
})
project.sudo().write(
{'type_ids': [(4, stages.search([(
'name', '=', rec['name'])])[0].id, project.id)]})
for card in self.get_cards(header, query,
board['id']):
if card['id'] not in self.env['project.task'].search([]).mapped(
'trello_reference'):
self.env['project.task'].create({
'name': card['name'],
'project_id': project.id,
'stage_id': self.env[
'project.task.type'].search([('name', '=',
self.get_a_list(
header, query,
card['idList'])[
'name'])])[0].id,
'trello_reference': card['id']
})
def action_export(self):
"""Function that exports Project, Stages and Tasks from Odoo to
@ -146,7 +149,6 @@ class ResUsers(models.Model):
response = requests.get(
f"https://api.trello.com/1/members/{username}",
headers=headers, timeout=10)
print(response,'member')
if response.status_code == 200:
return response.json()['id']
if response.status_code == 404:

BIN
odoo_trello_connector/static/description/assets/screenshots/img.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 271 KiB

BIN
odoo_trello_connector/static/description/assets/screenshots/img_1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

153
odoo_trello_connector/static/description/index.html

@ -33,7 +33,7 @@
style="background-color:#017E84 !important;font-size: 0.8rem !important; color:#fff !important; font-weight:500 !important; padding:4px !important; margin:0 3px !important; border-radius:50px !important; min-width: 120px !important;">
Community
</div>
<div class="text-center"
<div class="text-center"
style="background-color:#875A7B !important; color:#fff !important;font-size: 0.8rem !important; font-weight:500 !important; padding:4px !important; margin:0 3px !important; border-radius:50px !important;min-width: 120px !important;">
Enterprise
</div>
@ -49,7 +49,7 @@
style="margin: 80px 0px !important;">
<h1 style="font-size: 2.8rem;font-weight: 700; color:
#1A202C;">
Odoo Trello Connector</h1>
Odoo Trello Connector</h1>
<p class="my-3 mb-4"
style="max-width: 80%; font-weight: 400 !important; line-height: 32px; color: #718096;">
Integrate Projects and Tasks Between Trello and Odoo
@ -81,7 +81,7 @@
<div>
<p style="color: #1A202C;font-weight: 600;
font-size: 1.2rem; margin-bottom: 2px;">
Exports all Projects from Odoo to Trello</p>
Exports all Projects from Odoo to Trello</p>
</div>
</div>
</div>
@ -98,7 +98,7 @@
<div>
<p style="color: #1A202C;font-weight: 600;
font-size: 1.2rem; margin-bottom: 2px;">
Exports all Tasks from Odoo to Trello</p>
Exports all Tasks from Odoo to Trello</p>
</div>
</div>
</div>
@ -115,7 +115,7 @@
<div>
<p style="color: #1A202C;font-weight: 600;
font-size: 1.2rem; margin-bottom: 2px;">
Imports all Tasks from Trello to Odoo</p>
Imports all Tasks from Trello to Odoo</p>
</div>
</div>
</div>
@ -132,7 +132,7 @@
<div>
<p style="color: #1A202C;font-weight: 600;
font-size: 1.2rem; margin-bottom: 2px;">
Imports all Projects from Trello to Odoo</p>
Imports all Projects from Trello to Odoo</p>
</div>
</div>
</div>
@ -164,9 +164,32 @@
class="fa-solid fa-book-open pr-2"
style="color: #fff;"></i>Released Notes</a></li>
</ul>
<div class="tab-content"
style="background-color: rgba(121, 113, 119, 0.04);">
<div class="tab-content" style="background-color: rgba(121, 113, 119, 0.04);">
<div id="tab1" class="tab-pane fade in active show">
<div class="col-lg-12 py-2"
style="padding: 1rem 4rem !important;">
<div style="border: 1px solid #d8d6d6; border-radius: 4px; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);">
<div class="px-3">
<h3 class="mt16 mb0"
style="font-family:Roboto; font-weight:500; font-size:22px; color:#781d96">
Please ensure that the "Job queue and Queue Job Cron Jobrunner" module from Odoo Community Association (OCA) is installed on your system before installing our module.</h3>
<div class="col-lg-12 d-flex justify-content-center align-items-center"
style="margin: 2rem 0;">
<p class=" mt8" style="font-family:Roboto ; color: #280135;">Job queue - link to download : <a
href="https://apps.odoo.com/apps/modules/17.0/queue_job">
https://apps.odoo.com/apps/modules/17.0/queue_job/</a></p>
<br/>
<br/>
<p class=" mt8" style="font-family:Roboto ; color: #280135;"> Queue Job Cron Jobrunner - link to download : <a
href="https://apps.odoo.com/apps/modules/17.0/queue_job_cron_jobrunner">https://apps.odoo.com/apps/modules/17.0/queue_job_cron_jobrunner/</a>
</p>
</div>
</div>
</div>
</div>
<div class="col-lg-12 py-2"
style="padding: 1rem 4rem !important;">
<div style="border: 1px solid #d8d6d6; border-radius: 4px; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);">
@ -181,10 +204,10 @@
Steps to set up in Trello platform</h4>
<p style=" color:#718096!important; font-size:1rem !important;line-height: 28px;">
Login to <a
href="https://trello.com/power-ups/admin">Trello Power-Ups
Admin
Portal.</a>
Click on the New button under Power-Ups tab
href="https://trello.com/power-ups/admin">Trello Power-Ups
Admin
Portal.</a>
Click on the New button under Power-Ups tab
</p>
</div>
</div>
@ -201,9 +224,9 @@
<div class="px-3">
<h4 class="mt-2"
style=" font-weight:600 !important; color:#282F33 !important; font-size:1.3rem !important">
</h4>
</h4>
<p style=" color:#718096!important; font-size:1rem !important;line-height: 28px;">
Fill all fields and click Create button.
Fill all fields and click Create button.
</p>
</div>
</div>
@ -220,10 +243,10 @@
<div class="px-3">
<h4 class="mt-2"
style=" font-weight:600 !important; color:#282F33 !important; font-size:1.3rem !important">
</h4>
</h4>
<p style=" color:#718096!important; font-size:1rem !important;line-height: 28px;">
Click on Generate a new API key button under API key tab.
Click Token to generate Trello token.
Click on Generate a new API key button under API key tab.
Click Token to generate Trello token.
</p>
</div>
</div>
@ -239,10 +262,11 @@
</div>
<div class="px-3">
<h4 class="mt-2"
style=" font-weight:600 !important; color:#282F33 !important; font-size:1.3rem !important"> We can see the Username here.
</h4>
style=" font-weight:600 !important; color:#282F33 !important; font-size:1.3rem !important"> We can see the
Username here.
</h4>
<p style=" color:#718096!important; font-size:1rem !important;line-height: 28px;">
Click Token to generate Trello token
Click Token to generate Trello token
</p>
</div>
</div>
@ -259,10 +283,10 @@
<div class="px-3">
<h4 class="mt-2"
style=" font-weight:600 !important; color:#282F33 !important; font-size:1.3rem !important">
We can see the Username here.
</h4>
We can see the Username here.
</h4>
<p style=" color:#718096!important; font-size:1rem !important;line-height: 28px;">
Clock Allow button
Clock Allow button
</p>
</div>
</div>
@ -279,9 +303,9 @@
<div class="px-3">
<h4 class="mt-2"
style=" font-weight:600 !important; color:#282F33 !important; font-size:1.3rem !important">
</h4>
<p style=" color:#718096!important; font-size:1rem !important;line-height: 28px;">
We can see the Trello Token here.
</h4>
<p style=" color:#718096!important; font-size:1rem !important;line-height: 28px;">
We can see the Trello Token here.
</p>
</div>
</div>
@ -298,9 +322,9 @@
<div class="px-3">
<h4 class="mt-2"
style=" font-weight:600 !important; color:#282F33 !important; font-size:1.3rem !important">
</h4>
<p style=" color:#718096!important; font-size:1rem !important;line-height: 28px;">
Add the Credentials for connecting with Trello
</h4>
<p style=" color:#718096!important; font-size:1rem !important;line-height: 28px;">
Add the Credentials for connecting with Trello
</p>
</div>
</div>
@ -319,7 +343,7 @@
style=" font-weight:600 !important; color:#282F33 !important; font-size:1.3rem !important">
</h4>
<p style=" color:#718096!important; font-size:1rem !important;line-height: 28px;">
Projects in Odoo before Import
Projects in Odoo before Import
</p>
</div>
</div>
@ -336,13 +360,39 @@
<div class="px-3">
<h4 class="mt-2"
style=" font-weight:600 !important; color:#282F33 !important; font-size:1.3rem !important">
</h4>
</h4>
<p style=" color:#718096!important; font-size:1rem !important;line-height: 28px;">
Click on IMPORT button
</p>
</div>
</div>
</div>
<div class="col-lg-12 py-2"
style="padding: 1rem 4rem !important;">
<div
style="border: 1px solid #d8d6d6; border-radius: 4px; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);">
<div class="row justify-content-center p-3 w-100 m-0">
<img src="assets/screenshots/img.png"
class="img-responsive" width="100%"
height="auto">
</div>
<div class="row justify-content-center p-3 w-100 m-0">
<img src="assets/screenshots/img_1.png"
class="img-responsive" width="100%"
height="auto">
</div>
<div class="px-3">
<h4 class="mt-2"
style=" font-weight:600 !important; color:#282F33 !important; font-size:1.3rem !important">
</h4>
<p style=" color:#718096!important; font-size:1rem !important;line-height: 28px;">
if you open the Queue Job module, you can see all the data created as queues. Once the queues are complete, all your projects will be loaded.
</p>
</div>
</div>
</div>
<div class="col-lg-12 py-2"
style="padding: 1rem 4rem !important;">
<div
@ -355,9 +405,9 @@
<div class="px-3">
<h4 class="mt-2"
style=" font-weight:600 !important; color:#282F33 !important; font-size:1.3rem !important">
</h4>
</h4>
<p style=" color:#718096!important; font-size:1rem !important;line-height: 28px;">
Projects in Trello
Projects in Trello
</p>
</div>
</div>
@ -374,9 +424,9 @@
<div class="px-3">
<h4 class="mt-2"
style=" font-weight:600 !important; color:#282F33 !important; font-size:1.3rem !important">
</h4>
<p style=" color:#718096!important; font-size:1rem !important;line-height: 28px;">
Imported Projects in Odoo
</h4>
<p style=" color:#718096!important; font-size:1rem !important;line-height: 28px;">
Imported Projects in Odoo
</p>
</div>
</div>
@ -394,7 +444,7 @@
<h4 class="mt-2"
style=" font-weight:600 !important; color:#282F33 !important; font-size:1.3rem !important">
</h4>
<p style=" color:#718096!important; font-size:1rem !important;line-height: 28px;">
<p style=" color:#718096!important; font-size:1rem !important;line-height: 28px;">
Tasks in Trello Project
</p>
</div>
@ -413,13 +463,13 @@
<h4 class="mt-2"
style=" font-weight:600 !important; color:#282F33 !important; font-size:1.3rem !important">
</h4>
<p style=" color:#718096!important; font-size:1rem !important;line-height: 28px;">
Tasks in imported Project in Odoo
<p style=" color:#718096!important; font-size:1rem !important;line-height: 28px;">
Tasks in imported Project in Odoo
</p>
</div>
</div>
</div>
<div class="col-lg-12 py-2"
<div class="col-lg-12 py-2"
style="padding: 1rem 4rem !important;">
<div
style="border: 1px solid #d8d6d6; border-radius: 4px; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);">
@ -433,12 +483,12 @@
style=" font-weight:600 !important; color:#282F33 !important; font-size:1.3rem !important">
</h4>
<p style=" color:#718096!important; font-size:1rem !important;line-height: 28px;">
Click on EXPORT button
Click on EXPORT button
</p>
</div>
</div>
</div>
<div class="col-lg-12 py-2"
<div class="col-lg-12 py-2"
style="padding: 1rem 4rem !important;">
<div
style="border: 1px solid #d8d6d6; border-radius: 4px; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);">
@ -451,8 +501,8 @@
<h4 class="mt-2"
style=" font-weight:600 !important; color:#282F33 !important; font-size:1.3rem !important">
</h4>
<p style=" color:#718096!important; font-size:1rem !important;line-height: 28px;">
Exported Projects in Trello
<p style=" color:#718096!important; font-size:1rem !important;line-height: 28px;">
Exported Projects in Trello
</p>
</div>
</div>
@ -470,13 +520,13 @@
<h4 class="mt-2"
style=" font-weight:600 !important; color:#282F33 !important; font-size:1.3rem !important">
</h4>
<p style=" color:#718096!important; font-size:1rem !important;line-height: 28px;">
Tasks in Odoo Project
<p style=" color:#718096!important; font-size:1rem !important;line-height: 28px;">
Tasks in Odoo Project
</p>
</div>
</div>
</div>
<div class="col-lg-12 py-2"
<div class="col-lg-12 py-2"
style="padding: 1rem 4rem !important;">
<div
style="border: 1px solid #d8d6d6; border-radius: 4px; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);">
@ -489,8 +539,9 @@
<h4 class="mt-2"
style=" font-weight:600 !important; color:#282F33 !important; font-size:1.3rem !important">
</h4>
<p style=" color:#718096!important; font-size:1rem !important;line-height: 28px;">Tasks in exported Project in Trello
</p>
<p style=" color:#718096!important; font-size:1rem !important;line-height: 28px;">Tasks in exported Project in
Trello
</p>
</div>
</div>
</div>
@ -514,7 +565,7 @@
width="16px"></span>
Exports all Tasks from Odoo to Trello
</li>
<li class="py-3"
<li class="py-3"
style="font-weight: 500;background-color: #fff; border-radius: 4px; padding: 1rem; margin-bottom: 1rem; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);">
<span style="margin-right: 12px;"><img
src="assets/misc/star (1) 2.svg"
@ -522,7 +573,7 @@
width="16px"></span>
Imports all Tasks from Trello to Odoo
</li>
<li class="py-3"
<li class="py-3"
style="font-weight: 500;background-color: #fff; border-radius: 4px; padding: 1rem; margin-bottom: 1rem; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);">
<span style="margin-right: 12px;"><img
src="assets/misc/star (1) 2.svg"

Loading…
Cancel
Save