Skip to content

[20.0][MIG] jsonifier: Review formatting and migration - #1

Open
weinni2000 wants to merge 2 commits into
20.0-mig-jsonifier-review-basefrom
20.0-mig-jsonifier
Open

weinni2000 wants to merge 2 commits into
20.0-mig-jsonifier-review-basefrom
20.0-mig-jsonifier

Conversation

@weinni2000

@weinni2000 weinni2000 commented Oct 31, 2026 •

Copy link
Copy Markdown
Owner

Review the JSONifier migration to Odoo 20 in two stages. The base branch contains the replayed OCA history, so this PR contains only the formatting and migration commits.

  • Pre-commit changes: 64a8f0c
  • Migration changes after pre-commit: f209630

Fresh-database installation/tests and all repository pre-commit hooks pass.

Upstream PR: OCA#3835

Summary by Sourcery

Migrate JSONifier to Odoo 20 and align its runtime behavior, metadata, tests, and documentation with the new platform version.

Enhancements:

  • Migrate the JSONifier module to Odoo 20, including updated APIs, metadata, views, security files, and compatibility adjustments.
  • Improve parser cache invalidation by deriving cache keys from export field configuration rather than transaction write dates.
  • Refresh JSONifier tests to use programmatically created export configurations and Odoo 20 field labels.

Documentation:

  • Update JSONifier documentation and generated module metadata for the Odoo 20 branch.

Tests:

  • Refactor parser and export-line tests around a shared Odoo 20 test fixture.

Chores:

  • Apply repository formatting and cleanup changes, including updated filenames and removed obsolete credits.

@sourcery-ai

sourcery-ai Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Implementation

Update parser caching to key on export-field options that can change within a transaction, and use the Odoo 20 ormcache import.

  • jsonifier/models/ir_exports.py L8, L91-107

Adapt resolver evaluation to the current safe_eval API and keep its resolver guidance aligned with the code.

  • jsonifier/models/ir_exports_resolver.py L14-21 (+3 small edits)

Move export-line validation messages to the current translation API and preserve interpolation of field names.

  • jsonifier/models/ir_exports_line.py L52-57 (+3 small edits)

Update model error translation and tidy the parsing variables to match formatting conventions.

  • jsonifier/models/models.py L13 (removed lines), L30-31, L62

Rename the unused field-partition separator variable without changing parser behavior.

  • jsonifier/models/utils.py L11

Configuration

Bump the module version and point its data manifest at the renamed Odoo 20 access and view files.

  • jsonifier/__manifest__.py L9, L17-19

Replace the legacy model-access CSV with the Odoo 20 access file.

  • jsonifier/security/ir.access.csv L1-2
  • jsonifier/security/ir.model.access.csv (deleted)

Documentation

Refresh the module README, remove the outdated migration credit, and update the generated description page for Odoo 20.

  • jsonifier/README.rst L24-30 (+3 small edits)
  • jsonifier/static/description/index.html L6-597 (6 small edits)
  • jsonifier/readme/CREDITS.md (deleted)

Tests

Create shared export fixtures and update parser and JSON-export expectations for Odoo 20 field labels and cache behavior.

  • jsonifier/tests/common.py L1-36
  • jsonifier/tests/test_get_parser.py L114-118, L182-185, L227-230 (+6 small edits)

Reuse the shared export fixture in export-line validation tests instead of relying on demo records.

  • jsonifier/tests/test_ir_exports_line.py L6-9 (+5 small edits)

Other changes

Files not grouped.

  • jsonifier/views/ir_exports_resolver_view.xml L3-5
  • jsonifier/views/ir_exports_view.xml L3-5

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Approved.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Keep JSON exports and custom resolvers working on Odoo 20. Adapt access
rights to ir.access and use the current safe_eval and translation APIs.

Create export fixtures in tests so installation needs no demo data.
Include parser options in the cache key to handle edits made within the
same transaction, and update expectations for current field labels.

Core API changes:
odoo/odoo@77c17e7
odoo/odoo@e73f638

Validation: fresh-database odev install/tests and repository pre-commit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant