Skip to content

[ADD] web_list_record_popup: new module - #3522

Draft
rvalyi wants to merge 1 commit into
OCA:18.0from
akretion:18.0-add-web_list_record_popup
Draft

[ADD] web_list_record_popup: new module#3522
rvalyi wants to merge 1 commit into
OCA:18.0from
akretion:18.0-add-web_list_record_popup

Conversation

@rvalyi

@rvalyi rvalyi commented Apr 23, 2026

Copy link
Copy Markdown
Member

Extracted from what we used in the Brazilian localization in version 16.0

Recent Odoo versions allows quick edition of order lines with inline editable list.
But sometimes the user wants to read or edit more details on the lines through the Form popup. This modules allows the best of the two edition modes: you can still have quick edition via the inline list edition, but you now have a Javascript button you can click on to open the Form view popup using the view defined inline in the One2many field if any.

2026-04-23_04-46

Features:

  • Adds a popup button to editable lists in form views
  • Opens records in a form dialog instead of inline editing
  • Works with both existing and new (NewID) records
  • Optional activation - no hard dependencies

Usage:

A) To use it, adding a dependency to the web_list_record_popup module:

  1. Make your model inherit from web_list_record_popup.mixin
  2. Define _popup_button_xpaths class attribute with xpath expressions where buttons should be injected

Example:

    class MyModel(models.Model):
        _inherit = "web_list_record_popup.mixin"

        _popup_button_xpaths = [
            ("//field[@name='line_ids']/list/field[@name='product_id']", "before"),
        ]

B) If you prefer use it WITHOUT adding a hard dependency to the web_list_record_popup module instead:

Then don't add the module dependency and don't inherit from web_list_record_popup.mixin but override _get_view instead.

Example:

    class MyModel(models.Model):
        _popup_button_xpaths = [
            ("//field[@name='line_ids']/list/field[@name='product_id']", "before"),
        ]

    @api.model
    def _get_view(self, view_id=None, view_type="form", **options):
        arch, view = super()._get_view(view_id, view_type, **options)
        if view_type == "form" and "web_list_record_popup.mixin" in self.env:
            arch = self.env["web_list_record_popup.mixin"]._inject_popup_buttons(
                arch,
                self._popup_button_xpaths,
            )
        return arch, view

Thus, the popup button will only be injected if the web_list_record_popup module is installed.

I'm not sure why we cannot run the Hoot tests on Runboat, but here is a print of them passing locally:
2026-04-23_13-08

@rvalyi
rvalyi marked this pull request as draft April 23, 2026 03:52
@rvalyi
rvalyi force-pushed the 18.0-add-web_list_record_popup branch 5 times, most recently from 2657f53 to 079acbd Compare April 23, 2026 04:28
@OCA-git-bot OCA-git-bot added series:18.0 mod:web_list_record_popup Module web_list_record_popup labels Apr 23, 2026
@rvalyi
rvalyi force-pushed the 18.0-add-web_list_record_popup branch from 079acbd to bf720d7 Compare April 23, 2026 12:54
@rvalyi
rvalyi force-pushed the 18.0-add-web_list_record_popup branch from bf720d7 to 77dee3c Compare June 19, 2026 13:14
@rvalyi
rvalyi force-pushed the 18.0-add-web_list_record_popup branch from 77dee3c to 832eb3a Compare June 19, 2026 13:49
@rvalyi
rvalyi force-pushed the 18.0-add-web_list_record_popup branch 2 times, most recently from b6bf121 to 22c756f Compare July 22, 2026 14:12
@rvalyi
rvalyi force-pushed the 18.0-add-web_list_record_popup branch from 22c756f to 12a4042 Compare July 22, 2026 14:22
@CristianoMafraJunior

Copy link
Copy Markdown
Member

@rvalyi draft?

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

Labels

mod:web_list_record_popup Module web_list_record_popup series:18.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants