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. 20
      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. 59
      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):

20
odoo_trello_connector/models/res_users.py

@ -56,8 +56,14 @@ 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):
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:
@ -67,8 +73,7 @@ class ResUsers(models.Model):
'trello_reference': board['id']
})
for rec in self.get_list_on_board(header, query, board['id']):
stages = self.env[
'project.task.type'].search([])
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']
@ -76,10 +81,8 @@ class ResUsers(models.Model):
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'):
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,
@ -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

59
odoo_trello_connector/static/description/index.html

@ -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);">
@ -239,7 +262,8 @@
</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.
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
@ -343,6 +367,32 @@
</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
@ -489,7 +539,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;">Tasks in exported Project in Trello
<p style=" color:#718096!important; font-size:1rem !important;line-height: 28px;">Tasks in exported Project in
Trello
</p>
</div>
</div>

Loading…
Cancel
Save