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
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
1 change: 0 additions & 1 deletion vcp/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
from . import controllers
from . import models
13 changes: 1 addition & 12 deletions vcp/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@
"license": "AGPL-3",
"author": "Dixmit,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/version-control-platform",
"depends": ["website_partner"],
"depends": ["base"],
"data": [
"security/ir.model.access.csv",
"data/ir_cron.xml",
"templates/templates.xml",
"views/menu.xml",
"views/vcp_comment.xml",
"views/vcp_review.xml",
Expand All @@ -22,14 +21,4 @@
"views/vcp_platform.xml",
],
"demo": [],
"assets": {
"web.assets_frontend": [
"vcp/static/src/components/**/*.esm.js",
"vcp/static/src/components/**/*.xml",
"vcp/static/src/components/**/*.scss",
],
"web.assets_tests": [
"vcp/static/tests/**/*",
],
},
}
2 changes: 0 additions & 2 deletions vcp/models/res_partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ def _compute_vcp_contributions_field(self, field):
)

def _get_contributor_url(self):
if self.is_published and self.website_url:
return self.website_url
return False

def _get_contributors_name(self, kind, **kwargs):
Expand Down
2 changes: 1 addition & 1 deletion vcp/models/vcp_platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class VCPPlatform(models.Model):
image_64 = fields.Image(
max_width=64, max_height=64, store=True, related="image_1920", string="Image 64"
)
kind = fields.Selection([])
kind = fields.Selection([], required=True)
key_ids = fields.One2many(
comodel_name="vcp.platform.key",
inverse_name="platform_id",
Expand Down
2 changes: 1 addition & 1 deletion vcp/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from . import test_portal
from . import test_base
1 change: 1 addition & 0 deletions vcp/tests/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import vcp_platform
16 changes: 16 additions & 0 deletions vcp/tests/models/vcp_platform.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2026 GRAP
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
import logging

from odoo import fields, models

_logger = logging.getLogger(__name__)


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

kind = fields.Selection(
selection_add=[("dummy", "Dummy Value")],
ondelete={"dummy": "cascade"},
)
15 changes: 11 additions & 4 deletions vcp/tests/test_portal.py → vcp/tests/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,26 @@

from datetime import timedelta

from odoo_test_helper import FakeModelLoader

from odoo.fields import Date
from odoo.tests import tagged

from odoo.addons.base.tests.common import HttpCaseWithUserDemo, HttpCaseWithUserPortal


@tagged("post_install", "-at_install")
class TestUi(HttpCaseWithUserDemo, HttpCaseWithUserPortal):
class TestBase(HttpCaseWithUserDemo, HttpCaseWithUserPortal):
@classmethod
def setUpClass(cls):
super().setUpClass()
# Load fake order model
cls.loader = FakeModelLoader(cls.env, cls.__module__)
cls.loader.backup_registry()
from .models.vcp_platform import VCPPlatform

cls.loader.update_registry((VCPPlatform,))

# be sure some expected values are set otherwise homepage may fail
date = Date.today()
date = date - timedelta(days=date.day)
Expand All @@ -32,6 +41,7 @@ def setUpClass(cls):
"name": "oca",
"short_description": "OCA",
"description": "OCA",
"kind": "dummy",
}
)
repository = cls.env["vcp.repository"].create(
Expand Down Expand Up @@ -120,6 +130,3 @@ def setUpClass(cls):
"created_at": date,
}
)

def test_01_portal_load_tour(self):
self.start_tour("/", "portal_load_contributors_github", login="portal")
7 changes: 6 additions & 1 deletion vcp_github/models/vcp_platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
import requests
from pytz import UTC

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


class VcpPlatform(models.Model):
Expand All @@ -28,6 +29,10 @@ def _get_github_clients(self):
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
Expand Down
85 changes: 85 additions & 0 deletions vcp_portal/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
============
Vcp - Portal
============

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

.. |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_portal
: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_portal
: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 module extends the functionality of ``portal`` module, when ``vcp``
module is installed.

It adds a new entry in the partner portal menu.

|portal_menu|

When selecting this new item, partner has the possibility to see, some
indicators regarding contributions.

|portal_form|

.. |portal_menu| image:: https://raw.githubusercontent.com/OCA/version-control-platform/18.0/vcp_portal/static/description/portal_menu.png
.. |portal_form| image:: https://raw.githubusercontent.com/OCA/version-control-platform/18.0/vcp_portal/static/description/portal_form.png

**Table of contents**

.. contents::
:local:

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_portal%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
* GRAP

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_portal>`_ 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_portal/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import controllers
27 changes: 27 additions & 0 deletions vcp_portal/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright 2026 GRAP
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "Vcp - Portal",
"summary": "Glue module between Virtual Control Platform and Portal",
"version": "18.0.1.0.0",
"license": "AGPL-3",
"author": "Dixmit,GRAP,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/version-control-platform",
"depends": ["vcp", "portal"],
"data": [
"templates/templates.xml",
],
"demo": [],
"assets": {
"web.assets_frontend": [
"vcp_portal/static/src/components/**/*.esm.js",
"vcp_portal/static/src/components/**/*.xml",
"vcp_portal/static/src/components/**/*.scss",
],
"web.assets_tests": [
"vcp_portal/static/tests/**/*",
],
},
"auto_install": True,
}
File renamed without changes.
4 changes: 2 additions & 2 deletions vcp/controllers/main.py → vcp_portal/controllers/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def contributors_vcp(self, vcp=None):
if vcp is None:
vcps = request.env["vcp.platform"].search([])
return request.render(
"vcp.vcp_platforms_template",
"vcp_portal.vcp_platforms_template",
{"vcps": vcps, **values},
)
vcp_id = (
Expand All @@ -35,7 +35,7 @@ def contributors_vcp(self, vcp=None):
.id
)
return request.render(
"vcp.vcp_platform_template",
"vcp_portal.vcp_platform_template",
{"vcp": vcp_id, **values},
)

Expand Down
15 changes: 15 additions & 0 deletions vcp_portal/i18n/fr.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * vcp_website_portal
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 18.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
3 changes: 3 additions & 0 deletions vcp_portal/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
10 changes: 10 additions & 0 deletions vcp_portal/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
This module extends the functionality of `portal` module,
when `vcp` module is installed.

It adds a new entry in the partner portal menu.

![portal_menu](../static/description/portal_menu.png)

When selecting this new item, partner has the possibility to see, some indicators regarding contributions.

![portal_form](../static/description/portal_form.png)
Loading