Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
4c38c19
[ADD] vcp
etobella Jan 24, 2026
a3bf522
[ADD] vcp_github
etobella Jan 24, 2026
210cf91
[FIX] vcp: set kind field required at platform level. It doesn't make…
legalsylvain Jan 24, 2026
08481b4
[FIX] vcp_github: handle correctly the error, if no API Keys are defined
legalsylvain Jan 24, 2026
553b821
[IMP] vcp: remove dependancy on website
etobella Jan 25, 2026
60fde30
[ADD] vcp_website
etobella Jan 25, 2026
87acd02
[IMP] vcp: Create users and Organizations
etobella Jan 26, 2026
3a26fad
[FIX] vcp_github: use users and partners
etobella Jan 26, 2026
d91d863
[IMP] vcp_website: use users and organizations
etobella Jan 26, 2026
858ecde
[IMP] vcp: Remove portal dependancy
etobella Jan 26, 2026
2778fde
[ADD] vcp_portal
etobella Jan 26, 2026
85e1e5e
[MOV] vcp --> vcp_management
etobella Feb 20, 2026
d5d2455
[FIX] vcp_github: Fix rename from vcp.platform.type to vcp.host
etobella Feb 20, 2026
9cd928f
[FIX] vcp_portal: Fix rename from vcp.platform type to vcp.host
etobella Feb 20, 2026
cc90e94
[FIX] vcp_website: Fix rename from vcp.platform.type to vcp.host
etobella Feb 20, 2026
442d5ae
[IMP] vcp_management: Improve comments
etobella Feb 20, 2026
5cfc04d
[IMP] vcp_management: Add Host Type
etobella Feb 20, 2026
cf44f35
[IMP] vcp_portal: Adapt to Host Type
etobella Feb 20, 2026
6451eb4
[IMP] vcp_github: Adapt to Host Type
etobella Feb 20, 2026
10e7f58
[IMP] vcp_management: Add groups
etobella Feb 20, 2026
c9ebe93
[IMP] vcp_portal: Add groups
etobella Feb 20, 2026
7b8e419
[IMP] vcp_management: Handle importing by cron
etobella Feb 20, 2026
b0cb218
[IMP] vcp_github: Fix tests
etobella Feb 20, 2026
f2038aa
[IMP] vcp_management: add git url
etobella Feb 20, 2026
7842924
[IMP] vcp_github: add git url
etobella Feb 20, 2026
baea4a2
[IMP] vcp_management: Add rules & cloc review
etobella Feb 23, 2026
e9b4921
[IMP] vcp_github: Adapt tests and code to get data
etobella Feb 23, 2026
6ca55e1
[FIX] vcp_management: Add dependancies
etobella Feb 23, 2026
b8b2fbd
[FIX] vcp_management: Order of file loading
etobella Feb 23, 2026
15e357c
[IMP] vcp_management: Adding tests
etobella Feb 23, 2026
0c5f3ca
[FIX] vcp_management: Copy with depth 1
etobella Feb 23, 2026
abfc40b
[ADD] vcp_odoo: import odoo modules
etobella Feb 23, 2026
20b27bf
[FIX] vcp_management: Set default values, fix views
etobella Feb 23, 2026
59cd936
[IMP] vcp_odoo: add more fields
etobella Feb 23, 2026
91a0a1c
[IMP] vcp_management: better message, if folder is bad / not configured
legalsylvain Feb 24, 2026
7135aed
[IMP] vcp_odoo: remove warnings
etobella Feb 24, 2026
67418d1
[IMP] vcp_management: Pass rule information to a generic module and d…
etobella Feb 25, 2026
6f50b28
[IMP] vcp_odoo: adapt to mixin logic
etobella Feb 25, 2026
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
4 changes: 4 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# generated from manifests external_dependencies
GitPython
github3.py
pathspec
1 change: 1 addition & 0 deletions test-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
odoo_test_helper
211 changes: 211 additions & 0 deletions vcp_github/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,211 @@
==========
Vcp Github
==========

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:086596db3dcb4fa7565fc97cf01ccd22449731243622d4587a1f609eab8bc121
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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
: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
:target: https://github.com/OCA/version-control-platform/tree/18.0/vcp_github
:alt: OCA/version-control-platform
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/version-control-platform-18-0/version-control-platform-18-0-vcp_github
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/version-control-platform&target_branch=18.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

[ This file must be max 2-3 paragraphs, and is required.

The goal of this document is to explain quickly the features of this
module: “what” this module does and “what” it is for. ]

Example:

This module extends the functionality of ... to support ... and to allow
users to ...

**Table of contents**

.. contents::
:local:

Use Cases / Context
===================

[ This file is optional but strongly suggested to allow end-users to
evaluate the module's usefulness in their context. ]

BUSINESS NEED: It should explain the “why” of the module:

- what is the business requirement that generated the need to develop
this module
- in which context or use cases this module can be useful (practical
examples are welcome!).

APPROACH: It could also explain the approach to address the mentioned
need.

USEFUL INFORMATION: It can also inform on related modules:

- modules it depends on and their features
- other modules that can work well together with this one
- suggested setups where the module is useful (eg: multicompany,
multi-website)

Installation
============

[ This file must only be present if there are very specific installation
instructions, such as installing non-python dependencies. The audience
is systems administrators. ]

To install this module, you need to:

1. Do this ...

Configuration
=============

[ This file is not always required; it should explain **how to configure
the module before using it**; it is aimed at users with administration
privileges.

Please be detailed on the path to configuration (eg: do you need to
activate developer mode?), describe step by step configurations and the
use of screenshots is strongly recommended.]

To configure this module, you need to:

- Go to *App* > Menu > Menu item
- Activate boolean… > save
- …

Usage
=====

[ This file is required and contains the instructions on **“how”** to
use the module for end-users.

If the module does not have a visible impact on the user interface, just
add the following sentence:

This module does not impact the user interface.

If that’s not the case, please make sure that every usage step is
covered and remember that images speak more than words!]

To use this module, you need to:

- Go to *App* > Menu > Menu item

*insert screenshot!*

- In “Contact” form, add a value to field *xyz* > save

*insert screenshot!*

- The value of *xyz* is now displayed in the list view.

*insert screenshot!*

Known issues / Roadmap
======================

[ Enumerate known caveats and future potential improvements. It is
mostly intended for end-users, and can also help potential new
contributors discovering new features to implement. ]

- ...

Changelog
=========

[ The change log. The goal of this file is to help readers understand
changes between version. The primary audience is end users and
integrators. Purely technical changes such as code refactoring must not
be mentioned here.

This file may contain ONE level of section titles, underlined with the ~
(tilde) character. Other section markers are forbidden and will likely
break the structure of the README.rst or other documents where this
fragment is included. ]

11.0.x.y.z (YYYY-MM-DD)
-----------------------

- [BREAKING] Breaking changes come first.
(`#70 <https://github.com/OCA/repo/issues/70>`__)
- [ADD] New feature. (`#74 <https://github.com/OCA/repo/issues/74>`__)
- [FIX] Correct this. (`#71 <https://github.com/OCA/repo/issues/71>`__)

11.0.x.y.z (YYYY-MM-DD)
-----------------------

- ...

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/version-control-platform/issues>`_.
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
`feedback <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**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* Dixmit

Contributors
------------

- Firstname Lastname email.address@example.org (optional company website
url)
- Second Person second.person@example.org (optional company website url)

Other credits
-------------

[ This file is optional and contains additional credits, other than
authors, contributors, and maintainers. ]

The development of this module has been financially supported by:

- Company 1 name
- Company 2 name

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/version-control-platform <https://github.com/OCA/version-control-platform/tree/18.0/vcp_github>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions vcp_github/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
21 changes: 21 additions & 0 deletions vcp_github/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2026 Dixmit
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "Vcp Github",
"summary": """Integrate Virtual Control Platform with Github""",
"version": "18.0.1.0.0",
"license": "AGPL-3",
"author": "Dixmit,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/version-control-platform",
"depends": [
"vcp_management",
],
"external_dependencies": {
"python": ["github3.py"],
},
"data": [
"data/data.xml",
],
"demo": [],
}
11 changes: 11 additions & 0 deletions vcp_github/data/data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo noupdate="1">
<record id="vcp_github_host_type" model="vcp.host.type">
<field name="name">GitHub</field>
<field name="code">github</field>
</record>
<record id="vcp_github_host" model="vcp.host">
<field name="name">GitHub</field>
<field name="type_id" ref="vcp_github_host_type" />
</record>
</odoo>
5 changes: 5 additions & 0 deletions vcp_github/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from . import vcp_host
from . import vcp_platform
from . import vcp_repository
from . import vcp_user
from . import vcp_organization
19 changes: 19 additions & 0 deletions vcp_github/models/vcp_host.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2026 Dixmit
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import _, api, models
from odoo.exceptions import ValidationError


class VcpHost(models.Model):
_inherit = "vcp.host"

@api.constrains("type_id")
def _check_kind_github(self):
for record in self.filtered(lambda r: r.type_id.code == "github"):
platforms = self.search(
[("id", "!=", record.id), ("type_id.code", "=", "github")],
limit=1,
)
if platforms:
raise ValidationError(_("Only one GitHub Host type is allowed."))
15 changes: 15 additions & 0 deletions vcp_github/models/vcp_organization.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2026 Dixmit
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).


from odoo import models


class VcpOrganization(models.Model):
_inherit = "vcp.organization"

def _get_contributor_url(self):
result = super()._get_contributor_url()
if not result and self.host_id.type_id.code == "github":
return f"https://github.com/{self.external_id}"
return result
82 changes: 82 additions & 0 deletions vcp_github/models/vcp_platform.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# Copyright 2026 Dixmit
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

import base64
from datetime import datetime

import github3
import requests
from pytz import UTC

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


class VcpPlatform(models.Model):
_inherit = "vcp.platform"

def _get_git_url_github(self, repository):
return f"https://github.com/{self.name}/{repository.name}"

def _get_github_clients(self):
git = []
for key in self.key_ids:
git.append(github3.login(token=key.name))
return git

def _update_information_github(self):
self.ensure_one()
clients = self._get_github_clients()
if not clients:
raise ValidationError(
_("No github clients configured. Please enter at least an API Key.")
)
org = clients[0].organization(self.name)
self.short_description = org.name
self.description = org.description
if org.avatar_url:
response = requests.get(org.avatar_url, timeout=10)
response.raise_for_status()
self.image_1920 = base64.b64encode(response.content)
repos = org.repositories()
for repo in repos:
self._update_github_repository(repo)
self.last_update = fields.Datetime.now()

def _parse_github_date(self, date):
if not date:
return False
return UTC.normalize(
datetime.fromisoformat(date.replace("Z", "+00:00"))
).replace(tzinfo=None)

def _update_github_repository(self, repo):
vals = {
"created_at": self._parse_github_date(repo.created_at),
"stargazers_count": repo.stargazers_count,
"fork_count": repo.forks_count,
"watchers_count": repo.watchers_count,
"description": repo.description,
}
repository = self.env["vcp.repository"].search(
[
("name", "=", repo.name),
("platform_id", "=", self.id),
],
limit=1,
)
if not repository:
repository = (
self.env["vcp.repository"]
.sudo()
.create(
{
"name": repo.name,
"platform_id": self.id,
"from_date": vals.get("created_at"),
**vals,
}
)
)
else:
repository.sudo().write(vals)
Loading