Repository
OCA/server-tools · module folder · Try on Runboat
Module version
1.0.0
Category
tools
Folder size
0.06 MB
License
AGPL-3
Application
No
Auto-installable
No
Website
https://github.com/OCA/server-tools
Last tracking update
2026-09-25 23:16:44
Authors
Akretion, ACSONE SA/NV, Odoo Community Association (OCA)
Maintainers
Akretion, ACSONE SA/NV, Odoo Community Association (OCA)
Committers
Weblate, Florian Mounier, OCA-git-bot, oca-ci
Odoo dependencies
odoo/odoo:
Python dependencies
None
System dependencies
None
Required by
oca_search_engine
Description
The aim of this module is to provide a generic mixin for building urls on records.

The native odoo implementation of a record url is based on having an "id" in the url,
this module provides an alternative way of doing it.
Urls are generated and stored in an unique table (to ensure unicity).
Redirections are also managed in case of url changes.

This project was initial build for shopinvader as we need to have unique url for the connected webshop.
But this concept can be reused in other cases and even replace the odoo url implementation.

Code Analysis ⓘ

Views touched (2)
XML IDNameModelTypeStatus
url_view_form url.url form New
url_view_tree url.url list New
HTTP endpoints (0)

No HTTP endpoints found for this module.

Models touched (2)

New fields (5)
  • count_url Integer
    compute='_compute_count_url'
  • redirect_url_key Json
    compute='_compute_url_key' string='Redirect Url Keys'
  • url_ids One2many → url.url
    args: 'url.url', 'res_id'
  • url_key Char
    compute='_compute_url_key'
  • url_need_refresh Boolean
    compute='_compute_url_need_refresh' readonly=False store=True
Public methods (3)
  • open_url(self)
  • unlink(self)
  • write(self, vals)

New fields (9)
  • key Char
    index=True required=True
  • lang_id Many2one → res.lang
    index=True required=True string='Lang' args: 'res.lang'
  • manual Boolean
    default=True readonly=True
  • need_refresh Boolean
  • redirect Boolean
    help='If tick this url is a redirection to the new url'
  • referential Selection
    default='global' index=True required=True selection=<expr>
  • res_id Many2oneReference
    help='ID of the target record in the database' index=True model_field='res_model_field' readonly=True string='Record ID'
  • res_model Selection
    index=True readonly=True selection=<expr>
  • res_model_field Char
    compute='_compute_res_model_field' readonly=True store=True string='Model Name'
Public methods (1)
  • init(self)