pax_global_header 0000666 0000000 0000000 00000000064 13274642347 0014526 g ustar 00root root 0000000 0000000 52 comment=3af86367be70293a5055aa07726cfbcfa53803e8
odoo-addons-8.0-project_git/ 0000775 0000000 0000000 00000000000 13274642347 0016112 5 ustar 00root root 0000000 0000000 odoo-addons-8.0-project_git/project_git/ 0000775 0000000 0000000 00000000000 13274642347 0020423 5 ustar 00root root 0000000 0000000 odoo-addons-8.0-project_git/project_git/__init__.py 0000664 0000000 0000000 00000000213 13274642347 0022530 0 ustar 00root root 0000000 0000000 # -*- coding: utf-8 -*-
# Copyright(C) 2017 Patrik Dufresne Service Logiciel (http://www.patrikdufresne.com).
from . import project_git
odoo-addons-8.0-project_git/project_git/__openerp__.py 0000664 0000000 0000000 00000002021 13274642347 0023234 0 ustar 00root root 0000000 0000000 # -*- coding: utf-8 -*-
##############################################################################
#
# PDSL Invoice
# Copyright(C) 2017 Patrik Dufresne Service Logiciel (http://www.patrikdufresne.com).
#
##############################################################################
{
"name": "Project Git webhook",
"version": "8.0.2",
"author": "Patrik Dufresne Service Logiciel inc.",
"category": 'Tools',
"description": """
This module provide Gitlab Github integration for Project Tasks and Issues. When properly configured, Git commits are link to the right project issue or tasks.
To ease migration, a script is also provided.
If you have multiple database installed, you may need to add this module to server_wide_modules.
""",
"depends": [
'project',
'project_task_sequence',
],
"data": ['data/project_git_data.xml'],
'images': ['images/main_screenshot.png'],
'installable': True,
'active': False
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
odoo-addons-8.0-project_git/project_git/data/ 0000775 0000000 0000000 00000000000 13274642347 0021334 5 ustar 00root root 0000000 0000000 odoo-addons-8.0-project_git/project_git/data/project_git_data.xml 0000664 0000000 0000000 00000001537 13274642347 0025366 0 ustar 00root root 0000000 0000000
Original source: %s
' % ( i.web_url, i.web_url)) if i.notes: description += '"
body += html_escape(commit['message']).replace('\r\n', '
').replace('\r', '
').replace('\n', '
')
body += "
" body += '%s' % (commit['url'], commit['id']) body += "
" # TODO include file changes return body def _date(commit): if commit.get('timestamp'): # Format # Fri, 8 Sep 2017 14:57:26 -0400 d = parse(commit.get('timestamp')) return d.strftime('%a, %d %b %Y %H:%M:%S %z') def _message_id(commit): if commit.get('id'): return commit.get('id') + "@localhost" def msg_from_commits(data): """ Convert git hook data into message to be process by the openerp mailing process. """ # If data is a string, try to read it as a json. if hasattr(data, 'lower'): data = json.loads(data) messages = [] commits = data.get('commits', []) for commit in commits: msg_txt = Message() msg_txt.add_header('Content-Type', 'text/html; charset="UTF-8"') msg_txt.add_header('Subject', _subject(commit)) msg_txt.add_header('Date', _date(commit)) msg_txt.add_header('From', _from(commit)) msg_txt.add_header('Message-ID', _message_id(commit)) msg_txt.set_payload(_body(commit)) messages.append(msg_txt) return messages context = dict(context or {}) # For each commit received, process it as a new message. msg_ids = [] for msg_txt in msg_from_commits(data): msg = self.message_parse( cr, uid, msg_txt, save_original=False, context=context) # Try to find corresponding thread ids routes = self.git_find_threads(cr, uid, msg, context=context) if not routes: _logger.info('git-hook Message-Id %s: cannot be routed', msg['message_id']) continue # Append the commit message to all matching task. for model, thread_id in routes: context['thread_model'] = model msg_ids.append(self.git_append_commit_message(cr, uid, thread_id, msg, context=context)) _logger.info('git-hook Message-Id %s: appended to thread_ids: %s', msg['message_id'], thread_id) return msg_ids def git_find_threads(self, cr, uid, message_dict, context=None): """ Check if the given message has reference to a task code. """ body = message_dict.get('body') task_codes = task_code_re.findall(body) routes = [] if task_codes: thread_ids = self.pool['project.task'].search( cr, uid, [('code', 'in', task_codes)], context=context) routes.extend([('project.task', i) for i in thread_ids]) return routes odoo-addons-8.0-project_git/project_git/static/ 0000775 0000000 0000000 00000000000 13274642347 0021712 5 ustar 00root root 0000000 0000000 odoo-addons-8.0-project_git/project_git/static/description/ 0000775 0000000 0000000 00000000000 13274642347 0024235 5 ustar 00root root 0000000 0000000 odoo-addons-8.0-project_git/project_git/static/description/browser.png 0000664 0000000 0000000 00000011502 13274642347 0026425 0 ustar 00root root 0000000 0000000 PNG IHDR X m sRGB IDATx]TU SA(ǎH%B8HDy8##uĘɚlܷM6n2}\4>jQ/1Bi#dGQ>Ciߙ"MS]}ꞏ{T*>B&}+3ךb, @ @ I.xp]C]n\綷g1д\c @ @ -P>K,9>X⊀ӑ#G-\6\g @ @ %bdoY:7 P6m*Wi @ @ 1YK*nw/p*fcSS3/X{ @ @ C'R1bȐ @ @ T*P\ZSÇr8iz (G @ @`@1ōk1Si @ @ U '4)Sm*F~UUM @ @ !P:ml*3{| @ @ T%P5TU @ @ 4l @ @ Z+^AԼssj|w*sVƟūR )M+z;ӌﶥLdz~f2