Skip to content

[19.0][MIG] odoo_repository - #149

Open
alan196 wants to merge 160 commits into
OCA:19.0from
Jarsa-dev:19.0-mig-odoo_repository
Open

[19.0][MIG] odoo_repository#149
alan196 wants to merge 160 commits into
OCA:19.0from
Jarsa-dev:19.0-mig-odoo_repository

Conversation

@alan196

@alan196 alan196 commented Jul 29, 2026

Copy link
Copy Markdown

Migration of odoo_repository to 19.0.

Main changes for 19.0 compatibility:

  • Convert _sql_constraints to models.Constraint (old attribute no longer supported).
  • Replace odoo.osv.expression helpers with odoo.fields.Domain.
  • Remove @api.returns (removed in 19.0, RPC layer now converts recordsets to ids).
  • Replace fields.first() (removed) with recordset slicing.
  • Replace self._cr with self.env.cr.
  • Convert res.groups category_id to the new res.groups.privilege model.
  • Remove groups_id on ir.ui.view records (field removed; ACLs already restrict access).
  • Unwrap <group expand=...> in search views (no longer valid).
  • Remove target="inline" on the settings action.
  • Use self.env._ for translations.

Sébastien Alix added 30 commits July 29, 2026 06:34
Module to build and maintain an exhaustive list of Odoo modules
and their metadata:

- dependencies between them
- license
- authors
- maintainers
- lines of code
- ...
And handle GitHub token.
This could be an external package published on PyPI, but include it in
`odoo_repository` module for now to ease deployment.
This new data model is here to distinguish available upstream modules
and installed modules in a project.

It inherits from `odoo.module.branch` so it has access to all its data,
but is linked to an `odoo.project` and has its own `installed_version`
so it becomes easy to find modules that could be upgraded within a
project.
If new commits since the last scan are updating irrelevant files
regarding the collection of migration data (like PO files updated
automatically by Weblate), then we skip the scan as this is a process
that can be quite time consuming.

Even if the scan has been skipped we still push the last source and
target commits to Odoo.
As the RepositoryScanner (executed before MigrationScanner) has already
fetched the branches of the repository, we avoid to fetch them again
so the MigrationScanner will work on the local history of commits.

This allows to speed up the processing of related jobs.
Without new commits in repositories, a scan of all Odoo + OCA repositories
now takes about ~6min instead of ~13min.
Allows to run the tests locally in isolated environment like Docker.
Instead of global level as the user running the scanner could not have
write access to ~/.gitconfig.
As such, the configuration is done after the cloning of repository,
right before the fetch and later on the checkout (which is the operation
that consumes most of the memory, the configuration is here to reduce it).

Cloning operation itself is faster and consumes less memory with
'filter=blob:none' parameter.
OCA-git-bot and others added 22 commits July 29, 2026 06:34
Do not maintain the list of OCA repositories manually anymore, but sync
it automatically with https://github.com/OCA/repo-maintainer-conf.

All repositories having a default branch set to `master` or `main` will
be skipped (such repositories are not hosting Odoo modules). Others like
OpenUpgrade or OCB will be skipped too.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: module-composition-analysis-18.0/module-composition-analysis-18.0-odoo_repository
Translate-URL: https://translation.odoo-community.org/projects/module-composition-analysis-18-0/module-composition-analysis-18-0-odoo_repository/
And cache generated git repository in memory to speed up tests execution.
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: module-composition-analysis-18.0/module-composition-analysis-18.0-odoo_repository
Translate-URL: https://translation.odoo-community.org/projects/module-composition-analysis-18-0/module-composition-analysis-18-0-odoo_repository/
alan196 and others added 3 commits August 5, 2026 10:25
When the GitHub API rate limit is reached (403/429 responses), jobs were
retried with the standard retry pattern until reaching the max. retries,
ending up as failed jobs and spamming administrators with emails while
still hammering the API for each repository/module.

Detect rate limit responses (Retry-After / X-RateLimit-* headers) and
postpone the job until the limit is reset, without increasing its retry
counter.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Some Odoo standard modules (e.g. l10n_ve 14.0) define the manifest
'author' key as a list. As _get_author_ids() is decorated with ormcache,
the cache key hashing crashed with 'TypeError: unhashable type: list'
before even entering the method, making the scan job fail.

Convert the list to a tuple before calling the cached method.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Some modules ship files that odoo_addons_parser cannot handle, e.g.
nested <odoo> tags in XML data files that Odoo itself tolerates
(l10n_ro_stock_account 14.0, auth_impersonate_user 17.0...). The scan
job kept retrying and failing on them forever.

Log a warning and push an empty code analysis instead, so the scan
completes and the module is still registered with its manifest-less
data.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@sebalix sebalix left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your PRs and the fixes you included as well, I'll check them in ~2 weeks 👍

Regarding the commit [FIX] odoo_repository: do not fail scan on module code analysis error , it's probably linked to this issue: sebalix/odoo-addons-parser#18
I would prefer to fix odoo-addons-parser instead if you don't mind.

Comment thread requirements.txt
@@ -0,0 +1,4 @@
# generated from manifests external_dependencies
gitpython

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can add oca-port to make CI running

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants