Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,16 @@ Version Control Platform allows to import Git information and other kind of cont

[//]: # (addons)

This part will be replaced when running the oca-gen-addons-table script from OCA/maintainer-tools.
Available addons
----------------
addon | version | maintainers | summary
--- | --- | --- | ---
[vcp_git](vcp_git/) | 18.0.1.0.0 | | Allows to download code from git
[vcp_github](vcp_github/) | 18.0.1.0.0 | | Integrate Version Control Platform with Github
[vcp_management](vcp_management/) | 18.0.1.0.0 | | Management for your Version Control Platforms
[vcp_odoo](vcp_odoo/) | 18.0.1.0.0 | | Import Odoo modules from VCP Repositories
[vcp_portal](vcp_portal/) | 18.0.1.0.0 | | Version control platform integration with portal
[vcp_website](vcp_website/) | 18.0.1.0.0 | | Adds integration of VCP with Odoo Website

[//]: # (end addons)

Expand Down
16 changes: 16 additions & 0 deletions setup/_metapackage/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[project]
name = "odoo-addons-oca-version-control-platform"
version = "18.0.20260401.0"
dependencies = [
"odoo-addon-vcp_git==18.0.*",
"odoo-addon-vcp_github==18.0.*",
"odoo-addon-vcp_management==18.0.*",
"odoo-addon-vcp_odoo==18.0.*",
"odoo-addon-vcp_portal==18.0.*",
"odoo-addon-vcp_website==18.0.*",
]
classifiers=[
"Programming Language :: Python",
"Framework :: Odoo",
"Framework :: Odoo :: 18.0",
]
8 changes: 6 additions & 2 deletions vcp_git/README.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

=======
Vcp Git
=======
Expand All @@ -7,13 +11,13 @@ Vcp Git
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:086596db3dcb4fa7565fc97cf01ccd22449731243622d4587a1f609eab8bc121
!! source digest: sha256:1ca94913950dfe5023e3cbc4dfea32bd9c2afba8382c77319676bceda2cb69ae
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fversion--control--platform-lightgray.png?logo=github
Expand Down
29 changes: 29 additions & 0 deletions vcp_git/i18n/vcp_git.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * vcp_git
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 18.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: vcp_git
#: model:ir.model,name:vcp_git.model_vcp_repository_branch
msgid "Links Branches with Repositories"
msgstr ""

#. module: vcp_git
#: model:ir.model,name:vcp_git.model_vcp_repository
msgid "Repository"
msgstr ""

#. module: vcp_git
#: model:ir.model,name:vcp_git.model_vcp_platform
msgid "VCP Platform"
msgstr ""
26 changes: 16 additions & 10 deletions vcp_git/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
<title>Vcp Git</title>
<title>README.rst</title>
<style type="text/css">

/*
Expand Down Expand Up @@ -360,16 +360,21 @@
</style>
</head>
<body>
<div class="document" id="vcp-git">
<h1 class="title">Vcp Git</h1>
<div class="document">


<a class="reference external image-reference" href="https://odoo-community.org/get-involved?utm_source=readme">
<img alt="Odoo Community Association" src="https://odoo-community.org/readme-banner-image" />
</a>
<div class="section" id="vcp-git">
<h1>Vcp Git</h1>
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:086596db3dcb4fa7565fc97cf01ccd22449731243622d4587a1f609eab8bc121
!! source digest: sha256:1ca94913950dfe5023e3cbc4dfea32bd9c2afba8382c77319676bceda2cb69ae
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/version-control-platform/tree/18.0/vcp_git"><img alt="OCA/version-control-platform" src="https://img.shields.io/badge/github-OCA%2Fversion--control--platform-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/version-control-platform-18-0/version-control-platform-18-0-vcp_git"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/version-control-platform&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/license-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/version-control-platform/tree/18.0/vcp_git"><img alt="OCA/version-control-platform" src="https://img.shields.io/badge/github-OCA%2Fversion--control--platform-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/version-control-platform-18-0/version-control-platform-18-0-vcp_git"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/version-control-platform&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module adds the necessary code to download using git.</p>
<p>It should be parent on git possible origins, like github or gitlab.</p>
<p><strong>Table of contents</strong></p>
Expand All @@ -385,23 +390,23 @@ <h1 class="title">Vcp Git</h1>
</ul>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#toc-entry-1">Bug Tracker</a></h1>
<h2><a class="toc-backref" href="#toc-entry-1">Bug Tracker</a></h2>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/version-control-platform/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/version-control-platform/issues/new?body=module:%20vcp_git%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
<h1><a class="toc-backref" href="#toc-entry-2">Credits</a></h1>
<h2><a class="toc-backref" href="#toc-entry-2">Credits</a></h2>
<div class="section" id="authors">
<h2><a class="toc-backref" href="#toc-entry-3">Authors</a></h2>
<h3><a class="toc-backref" href="#toc-entry-3">Authors</a></h3>
<ul class="simple">
<li>Dixmit</li>
</ul>
</div>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#toc-entry-4">Contributors</a></h2>
<h3><a class="toc-backref" href="#toc-entry-4">Contributors</a></h3>
<ul class="simple">
<li><a class="reference external" href="https://www.dixmit.com">Dixmit</a><ul>
<li>Enric Tobella</li>
Expand All @@ -410,7 +415,7 @@ <h2><a class="toc-backref" href="#toc-entry-4">Contributors</a></h2>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-5">Maintainers</a></h2>
<h3><a class="toc-backref" href="#toc-entry-5">Maintainers</a></h3>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org">
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
Expand All @@ -423,5 +428,6 @@ <h2><a class="toc-backref" href="#toc-entry-5">Maintainers</a></h2>
</div>
</div>
</div>
</div>
</body>
</html>
8 changes: 6 additions & 2 deletions vcp_github/README.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

==========
Vcp Github
==========
Expand All @@ -7,13 +11,13 @@ Vcp Github
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:086596db3dcb4fa7565fc97cf01ccd22449731243622d4587a1f609eab8bc121
!! source digest: sha256:e658564d23337fe17b8a0bda9c6f780e8a4ce61ef1368682e9dbeded389b3be8
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fversion--control--platform-lightgray.png?logo=github
Expand Down
55 changes: 55 additions & 0 deletions vcp_github/i18n/vcp_github.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * vcp_github
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 18.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: vcp_github
#. odoo-python
#: code:addons/vcp_github/models/vcp_platform.py:0
msgid ""
"No github clients configured. Please enter at least a Github Personal Access"
" Token. You can check more information at "
"https://docs.github.com/en/authentication/keeping-your-account-and-data-"
"secure/managing-your-personal-access-tokens"
msgstr ""

#. module: vcp_github
#. odoo-python
#: code:addons/vcp_github/models/vcp_host.py:0
msgid "Only one GitHub Host type is allowed."
msgstr ""

#. module: vcp_github
#: model:ir.model,name:vcp_github.model_vcp_organization
msgid "Organization"
msgstr ""

#. module: vcp_github
#: model:ir.model,name:vcp_github.model_vcp_repository
msgid "Repository"
msgstr ""

#. module: vcp_github
#: model:ir.model,name:vcp_github.model_vcp_user
msgid "User"
msgstr ""

#. module: vcp_github
#: model:ir.model,name:vcp_github.model_vcp_host
msgid "VCP Host"
msgstr ""

#. module: vcp_github
#: model:ir.model,name:vcp_github.model_vcp_platform
msgid "VCP Platform"
msgstr ""
6 changes: 6 additions & 0 deletions vcp_github/models/vcp_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
class VcpRepository(models.Model):
_inherit = "vcp.repository"

def _get_repository_url(self):
result = super()._get_repository_url()
if not result and self.platform_id.host_id.type_id.code == "github":
return f"https://github.com/{self.platform_id.name}/{self.name}"
return result

def _update_branches_github(self):
self.ensure_one()
client = self.platform_id._get_github_clients()[0]
Expand Down
41 changes: 40 additions & 1 deletion vcp_github/models/vcp_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).


from odoo import models
import logging
from datetime import datetime

import github3

from odoo import fields, models
from odoo.exceptions import ValidationError

_logger = logging.getLogger(__name__)


class VcpUser(models.Model):
Expand All @@ -13,3 +21,34 @@ def _get_contributor_url(self):
if not result and self.host_id.type_id.code == "github":
return f"https://github.com/{self.external_id}"
return result

def _prepare_user_vals(self, user):
return {
"name": user.name or user.login,
"email": user.email,
"avatar_url": user.avatar_url,
"company": user.company,
}

def _update_information_github(self):
self.ensure_one()
# TODO maybe we should move the api key on the host ?
platform = self.env["vcp.platform"].search(
[("host_id", "=", self.host_id.id)], limit=1
)
client = platform._get_github_clients()[0]
try:
user = client.user(self.external_id)
self.write(self._prepare_user_vals(user))
except github3.exceptions.ForbiddenError as e:
_logger.error(e)
rate = client.rate_limit()
reset = fields.Datetime.to_string(
datetime.utcfromtimestamp(rate["resources"]["core"]["reset"])
)
raise ValidationError(self.env._(f"Reset on {reset}")) from e
except github3.exceptions.NotFoundError:
_logger.warning(
"The user %s do not exist anymore, inactive it", self.external_id
)
self.active = False
26 changes: 16 additions & 10 deletions vcp_github/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
<title>Vcp Github</title>
<title>README.rst</title>
<style type="text/css">

/*
Expand Down Expand Up @@ -360,16 +360,21 @@
</style>
</head>
<body>
<div class="document" id="vcp-github">
<h1 class="title">Vcp Github</h1>
<div class="document">


<a class="reference external image-reference" href="https://odoo-community.org/get-involved?utm_source=readme">
<img alt="Odoo Community Association" src="https://odoo-community.org/readme-banner-image" />
</a>
<div class="section" id="vcp-github">
<h1>Vcp Github</h1>
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:086596db3dcb4fa7565fc97cf01ccd22449731243622d4587a1f609eab8bc121
!! source digest: sha256:e658564d23337fe17b8a0bda9c6f780e8a4ce61ef1368682e9dbeded389b3be8
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/version-control-platform/tree/18.0/vcp_github"><img alt="OCA/version-control-platform" src="https://img.shields.io/badge/github-OCA%2Fversion--control--platform-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/version-control-platform-18-0/version-control-platform-18-0-vcp_github"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/version-control-platform&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/license-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/version-control-platform/tree/18.0/vcp_github"><img alt="OCA/version-control-platform" src="https://img.shields.io/badge/github-OCA%2Fversion--control--platform-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/version-control-platform-18-0/version-control-platform-18-0-vcp_github"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/version-control-platform&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module facilitates the integration between Github and Version
Control Platform.</p>
<p><strong>Table of contents</strong></p>
Expand All @@ -385,23 +390,23 @@ <h1 class="title">Vcp Github</h1>
</ul>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#toc-entry-1">Bug Tracker</a></h1>
<h2><a class="toc-backref" href="#toc-entry-1">Bug Tracker</a></h2>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/version-control-platform/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/version-control-platform/issues/new?body=module:%20vcp_github%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
<h1><a class="toc-backref" href="#toc-entry-2">Credits</a></h1>
<h2><a class="toc-backref" href="#toc-entry-2">Credits</a></h2>
<div class="section" id="authors">
<h2><a class="toc-backref" href="#toc-entry-3">Authors</a></h2>
<h3><a class="toc-backref" href="#toc-entry-3">Authors</a></h3>
<ul class="simple">
<li>Dixmit</li>
</ul>
</div>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#toc-entry-4">Contributors</a></h2>
<h3><a class="toc-backref" href="#toc-entry-4">Contributors</a></h3>
<ul class="simple">
<li><a class="reference external" href="https://www.dixmit.com">Dixmit</a><ul>
<li>Enric Tobella</li>
Expand All @@ -410,7 +415,7 @@ <h2><a class="toc-backref" href="#toc-entry-4">Contributors</a></h2>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-5">Maintainers</a></h2>
<h3><a class="toc-backref" href="#toc-entry-5">Maintainers</a></h3>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org">
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
Expand All @@ -423,5 +428,6 @@ <h2><a class="toc-backref" href="#toc-entry-5">Maintainers</a></h2>
</div>
</div>
</div>
</div>
</body>
</html>
Loading