Maintainers
+Maintainers
This module is maintained by the OCA.
@@ -521,6 +516,5 @@ diff --git a/vcp_management/README.rst b/vcp_management/README.rst index 47e3b4f..6e30f6c 100644 --- a/vcp_management/README.rst +++ b/vcp_management/README.rst @@ -1,7 +1,3 @@ -.. image:: https://odoo-community.org/readme-banner-image - :target: https://odoo-community.org/get-involved?utm_source=readme - :alt: Odoo Community Association - ============== VCP Management ============== @@ -17,7 +13,7 @@ VCP Management .. |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/license-AGPL--3-blue.png +.. |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 diff --git a/vcp_management/__manifest__.py b/vcp_management/__manifest__.py index c6b4a20..c003f3b 100644 --- a/vcp_management/__manifest__.py +++ b/vcp_management/__manifest__.py @@ -4,7 +4,7 @@ { "name": "VCP Management", "summary": """Management for your Version Control Platforms""", - "version": "18.0.1.0.1", + "version": "18.0.1.0.2", "license": "AGPL-3", "author": "Dixmit,Odoo Community Association (OCA)", "website": "https://github.com/OCA/version-control-platform", diff --git a/vcp_management/migrations/18.0.1.0.2/pre-migration.py b/vcp_management/migrations/18.0.1.0.2/pre-migration.py new file mode 100644 index 0000000..38f8f8f --- /dev/null +++ b/vcp_management/migrations/18.0.1.0.2/pre-migration.py @@ -0,0 +1,29 @@ +# Copyright 2026 Dixmit +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +import logging + +_logger = logging.getLogger(__name__) + + +def migrate(cr, version): + if not version: + return + + _logger.info( + "Safely casting 'color' from VARCHAR to INTEGER in vcp_request_label..." + ) + + # 1. First, handle any edge cases where color might be empty or not a number + cr.execute(""" + UPDATE vcp_request_label + SET color = '0' + WHERE color IS NULL OR color = '' OR color !~ '^[0-9]+$'; + """) + + # 2. Use the 'USING' clause to safely cast the strings to integers + cr.execute(""" + ALTER TABLE vcp_request_label + ALTER COLUMN color TYPE int4 USING color::integer; + """) + + _logger.info("Successfully converted 'color' column.") diff --git a/vcp_management/models/vcp_request_label.py b/vcp_management/models/vcp_request_label.py index 5058c16..eb97735 100644 --- a/vcp_management/models/vcp_request_label.py +++ b/vcp_management/models/vcp_request_label.py @@ -13,7 +13,7 @@ class VcpRequestLabel(models.Model): name = fields.Char(required=True, readonly=True) - color = fields.Char(default=lambda x: x._default_color()) + color = fields.Integer(default=lambda x: x._default_color()) request_ids = fields.Many2many( comodel_name="vcp.request", diff --git a/vcp_management/static/description/index.html b/vcp_management/static/description/index.html index 19170a0..065b147 100644 --- a/vcp_management/static/description/index.html +++ b/vcp_management/static/description/index.html @@ -3,7 +3,7 @@
-Creates a set of modules used for handling a version control patform.
Table of contents
The aim of this module is to allow any community to import data from a version control system.
The system should be done in a way that is agnostic to the system and the connections are handled directly by specific modules.
Hosts are the origin of data. Each host has a type that helps us know how to integrate with the system. For example, on Github there is only one host (github.com). However, in Gitlab there could be one for each instance that we are integrating too.
We understand that a platform is an entity that can provide code and information to our Version Control Platform (VCP). A platform could be an organization on Github (like OCA) or Gitlab for example.
A repository is an origin of code. For example, this repository could be a VCP repository.
First step is to create a Platform. In the platform we need to set the host (you might need to create it on gitlab) and add some Platform Keys.
This keys will allow us to integrate with the origin system.
By default, the system provides some refresh rules for platforms and repositories, however we can deactivate or activate it manualy.
One of the capabilities of this module is the generation of rules.
This rules allow us to know some information of the repository.
By default, the system adds some rules aligned with odoo to make it @@ -479,7 +474,7 @@
Bugs are tracked on GitHub 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 @@ -487,15 +482,15 @@
Do not contact contributors directly about support or help with technical issues.