Skip to content
Merged
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
9 changes: 9 additions & 0 deletions odoo_repository/models/odoo_module_branch.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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=(
Expand Down Expand Up @@ -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:
Expand Down