From d309c46a4565dc0922417f00ad70f03f5ad559b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Alix?= Date: Wed, 28 May 2025 14:50:18 +0200 Subject: [PATCH] odoo_repository: new field '.full_path' --- odoo_repository/models/odoo_module_branch.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/odoo_repository/models/odoo_module_branch.py b/odoo_repository/models/odoo_module_branch.py index 3105789a..4250cde9 100644 --- a/odoo_repository/models/odoo_module_branch.py +++ b/odoo_repository/models/odoo_module_branch.py @@ -1,6 +1,7 @@ # Copyright 2023 Camptocamp SA # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) +import pathlib import random import time from urllib.parse import urlparse @@ -172,6 +173,7 @@ class OdooModuleBranch(models.Model): addons_path = fields.Char( help="Technical field. Where the module is located in the repository." ) + full_path = fields.Char(compute="_compute_full_path") url = fields.Char("URL", compute="_compute_url") specific = fields.Boolean( help=( @@ -234,6 +236,13 @@ def _check_generic_depends_on_specific(self): } ) + @api.depends("module_name", "addons_path") + def _compute_full_path(self): + for rec in self: + rec.full_path = pathlib.Path(rec.addons_path or ".").joinpath( + rec.module_name + ) + @api.depends("repository_id.repo_url", "branch_name", "addons_path", "module_name") def _compute_url(self): for rec in self: