Skip to content

T2911 Migrate website_crm_request#337

Merged
ecino merged 11 commits into
18.0from
nip/18.0-website_crm_request
Jun 10, 2026
Merged

T2911 Migrate website_crm_request#337
ecino merged 11 commits into
18.0from
nip/18.0-website_crm_request

Conversation

@Prazn

@Prazn Prazn commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Goal

The goal of this PR is to migrate the module website_crm_request to version 18.

Technical Aspects

  • replaced deprecated dependency website_form with website
  • specified form as editor asset in website.assets_editor

Misc

@Prazn Prazn self-assigned this Jun 8, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request upgrades the website_crm_request module to Odoo 18.0, migrating the JS code to the modern @odoo-module format and introducing a new snippet template for the CRM request form. The review feedback highlights a few issues in the new template that need to be addressed: placeholder/debug text in the template name, a placeholder redirect URL (/blblblbl), and an inconsistency where the email_from field is missing the required="1" attribute despite being marked as required in the JS registry.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread website_crm_request/views/snippets_template.xml Outdated
Comment thread website_crm_request/views/snippets_template.xml Outdated
Comment thread website_crm_request/views/snippets_template.xml Outdated
@Prazn

Prazn commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request migrates the website_crm_request module to Odoo 18, updating the manifest, dependencies, and converting legacy JavaScript assets to ES modules. However, several critical issues need to be addressed: the formbuilder_whitelist function in form_data.xml is deprecated in Odoo 18 and will cause installation errors, and the ES module import for formEditorRegistry must be updated to a named import to prevent runtime errors. Additionally, minor formatting consistency improvements are suggested for the manifest file.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread website_crm_request/data/form_data.xml
Comment thread website_crm_request/static/src/js/website_crm_request.esm.js
Comment thread website_crm_request/__manifest__.py Outdated
@Prazn Prazn requested a review from ecino June 8, 2026 11:50
@Prazn Prazn marked this pull request as ready for review June 8, 2026 11:50
@greptile-apps

greptile-apps Bot commented Jun 8, 2026

Copy link
Copy Markdown

Confidence Score: 5/5

Clean migration change with no functional regressions — safe to merge once the stray blank line is cleaned up.

All changes are mechanical modernisation: the dependency swap, asset registration move, and ESM conversion are straightforward and align with standard Odoo 18 patterns. The formbuilder_whitelist and formFields entries are now in sync after removing categ_id. The only thing introduced by this PR that wasn't in the original code is a stray blank line in the ESM file.

No files require special attention.

Important Files Changed

Filename Overview
website_crm_request/manifest.py Version bumped to 18.0, deprecated website_form dependency replaced with website, assets moved inline to manifest, module enabled (installable: True).
website_crm_request/data/form_data.xml Removed categ_id from formbuilder_whitelist as discussed in prior review thread; remaining four fields match formFields in the ESM JS exactly.
website_crm_request/static/src/js/website_crm_request.esm.js New ESM module replacing legacy odoo.define JS; imports from @website/js/form_editor_registry and @web/core/l10n/translation are correct for Odoo 18; stray blank line in email_from entry.
website_crm_request/static/src/js/website_crm_request.js Deleted legacy odoo.define-style JS file; replaced by the new .esm.js equivalent.
website_crm_request/templates/assets.xml Deleted; asset registration now handled via the assets key in manifest.py, which is the correct Odoo 16+ approach.
website_crm_request/pyproject.toml New file; configures whool as the build backend, consistent with the whool-init pre-commit hook already in .pre-commit-config.yaml.
.pre-commit-config.yaml Removes website_crm_request from the pre-commit exclusion list, correctly reflecting that the module is now installable and should be linted.

Sequence Diagram

sequenceDiagram
    participant Browser
    participant WebsiteEditor as Website Editor (assets_editor)
    participant FormEditorRegistry as FormEditorRegistry<br/>(@website/js/form_editor_registry)
    participant OdooServer as Odoo Server (ir.model)

    Browser->>WebsiteEditor: Load editor assets
    WebsiteEditor->>FormEditorRegistry: import FormEditorRegistry
    FormEditorRegistry-->>WebsiteEditor: registry instance
    WebsiteEditor->>FormEditorRegistry: "add("crm_request", { formFields: [...] })"

    Browser->>OdooServer: form_data.xml loaded on install
    OdooServer->>OdooServer: "Set website_form_key="crm_request" on crm.claim ir.model"
    OdooServer->>OdooServer: formbuilder_whitelist(crm.claim, [name, email_from, partner_phone, description])

    Browser->>OdooServer: Website form submission (POST)
    OdooServer->>OdooServer: Validate fields against whitelist
    OdooServer-->>Browser: 200 OK / crm.claim record created
Loading

Reviews (3): Last reviewed commit: "[T2911] REFACTOR : remove unused field" | Re-trigger Greptile

Comment thread website_crm_request/data/form_data.xml
Comment thread website_crm_request/static/src/js/website_crm_request.esm.js Outdated

@ecino ecino left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good for me, you can just remove the categ_id field from the whitelist.

Comment thread website_crm_request/data/form_data.xml
@ecino ecino merged commit bce597b into 18.0 Jun 10, 2026
1 check passed
@ecino ecino deleted the nip/18.0-website_crm_request branch June 10, 2026 10:45
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.

2 participants