Skip to content

[19.0][MIG] screen_help: reinvented version of help_module - #653

Open
bealdav wants to merge 12 commits into
OCA:19.0from
akretion:19-screen-help
Open

bealdav wants to merge 12 commits into
OCA:19.0from
akretion:19-screen-help

Conversation

@bealdav

@bealdav bealdav commented Oct 17, 2026 •

Copy link
Copy Markdown
Member

Not a really critical module but convenient to document features

help1 help2 help3

cc @gurneyalex @hbrunn @dreispt

@bealdav bealdav mentioned this pull request Oct 17, 2026
5 of 6 tasks
@bealdav
bealdav marked this pull request as ready for review October 17, 2026 16:04

@hbrunn hbrunn 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.

not sure why you renamed this? i mean, it still pops up help?

please remove all the bullshit comments in code files, they have negative value for readability of the code.

Comment thread screen_help/controllers/main.py Outdated
Comment on lines +11 to +14
def _response(self, html):
return request.make_response(
html, headers=[("Content-Type", "text/html; charset=utf-8")]
)

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.

what's the point of this function?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

def _response is now removed. Thanks

Comment thread screen_help/controllers/main.py Outdated
else:
title, prefix = env["ir.model"]._get(model).name or model, "help"
body, toc = env["help.section"]._for(action, model)._html(prefix)
html = env["ir.actions.report"]._render_template(

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.

what's the reason for rendering this as a report instead of passing template and context to the response? I'd also rather see ir.http#webclient_rendering_context included here instead of the _dark function, making all of this more standard Odoo

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

done

Comment thread screen_help/controllers/main.py Outdated
@http.route("/screen_help/app/<int:menu_id>", type="http", auth="user")
def app_help(self, menu_id):
"""Help of all the screens of an application (root menu)"""
html, __ = request.env["ir.actions.report"]._render_qweb_html(

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.

same question as above

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

done

Comment thread screen_help/models/help_section.py Outdated
FRONT_MATTER_RE = re.compile(r"\A---\s*\n(.*?)\n---\s*\n", re.DOTALL)


def front_matter(text):

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.

why is this not a model function to allow overrides?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

is now def _front_matter(self, text):

as Markdown files (see `_load_markdown`).

A section targets either a window action, or a model: then it is shown on
every screen of this model, whatever the action."""

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.

I suggest to allow also targeting specific menus, as some window actions are generic and depending on the menu, other help texts are appropriate

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Maybe I can add it in ROADMAP if you need a such feature ?

from odoo import fields, models


class IrActionsActWindow(models.Model):

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.

support for client actions would be nice, but I see how this is difficult

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Can you explain use cases ? And shouldn't implement it in another module ?

Comment thread screen_help/readme/CONTRIBUTORS.md Outdated
- [Akretion](https://www.akretion.com):
- David Beal <david.beal@akretion.com>
Original help_popup author augmented and renamed to screen_help
Assisted-by: Claude Opus 5.5

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.

this goes in the commit message

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

ok

<div class="o_help_content flex-grow-1" style="min-width: 0;">
<t t-out="0" />
</div>
</div>

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.

it would be nice if this included some javascript that looks for data-* attributes which allow linking to some action in Odoo, as not all actions have paths

t-on-click="onClickHelp"
>
<!-- Book icon: documentation of the screen -->
<i class="fa fa-book" />

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.

I'd find circle-question or some other icon involving a question mark more appropriate

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

ok

if (
not self.env.context.get("install_module")
and set(vals) & set(self._file_fields)
and any(self.mapped("file"))

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.

this seems to make it impossible to overwrite some generic help texts in a customer-specific module with xml records? I'd suggest to also check for install_mode

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Ok, for install mode. If you have to override this section, maybe it's easy to do it when you'll have a such case ?

@bealdav

bealdav commented Oct 23, 2026

Copy link
Copy Markdown
Member Author

Thanks @hbrunn for your full review.

I renamed because a popup is inside a tab. In this case this a new window.

But @tonygalmiche suggest me to support a way to embed documentation near chatter place. It seems a good idea with user preference.
But now I really don't know which name must be chosen for this module ;-)

The main purpose of the module, is that the documentation is contextual to the current page. I don't know if we could find a good name with this consideration.

Thanks for any suggestion

I'll answer to all your other requests.

@hbrunn

hbrunn commented Oct 24, 2026

Copy link
Copy Markdown
Member

the word pop-up was a thing long before there was the concept of browser tabs ;-) but anyways, why not just help? I also liked the name help_online which is abandoned by now.

the exact way of displaying should be something easy to tinker with in other modules/user preferences in any case, as I can imagine ie showing this full screen on mobile, or indeed a popup to move to a second screen can be very useful.

finally, as there's not really anything left of the old module, I'm not sure it makes sense to carry the old commits forward.


_name = "help.section"
_description = "Help Section"
_order = "sequence, id"

@hbrunn hbrunn Oct 24, 2026 •

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.

set _rec_name to something useful here or override _compute_display_name

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I addded _compute_display_name to have a better display

@bealdav bealdav left a comment •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@hbrunn I'll let confirm it'OK before to:

  • rename module as help, why not
  • make it possible to display help near chatter place
  • remove commits from help_module

Comment thread screen_help/models/help_section.py Outdated
FRONT_MATTER_RE = re.compile(r"\A---\s*\n(.*?)\n---\s*\n", re.DOTALL)


def front_matter(text):

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

is now def _front_matter(self, text):

Comment thread screen_help/controllers/main.py Outdated
Comment on lines +11 to +14
def _response(self, html):
return request.make_response(
html, headers=[("Content-Type", "text/html; charset=utf-8")]
)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

def _response is now removed. Thanks

t-on-click="onClickHelp"
>
<!-- Book icon: documentation of the screen -->
<i class="fa fa-book" />

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

ok

Comment thread screen_help/readme/CONTRIBUTORS.md Outdated
- [Akretion](https://www.akretion.com):
- David Beal <david.beal@akretion.com>
Original help_popup author augmented and renamed to screen_help
Assisted-by: Claude Opus 5.5

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

ok

Comment thread screen_help/controllers/main.py Outdated
else:
title, prefix = env["ir.model"]._get(model).name or model, "help"
body, toc = env["help.section"]._for(action, model)._html(prefix)
html = env["ir.actions.report"]._render_template(

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

done


_name = "help.section"
_description = "Help Section"
_order = "sequence, id"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I addded _compute_display_name to have a better display

from odoo import fields, models


class IrActionsActWindow(models.Model):

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Can you explain use cases ? And shouldn't implement it in another module ?

Comment thread screen_help/controllers/main.py Outdated
@http.route("/screen_help/app/<int:menu_id>", type="http", auth="user")
def app_help(self, menu_id):
"""Help of all the screens of an application (root menu)"""
html, __ = request.env["ir.actions.report"]._render_qweb_html(

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

done

as Markdown files (see `_load_markdown`).

A section targets either a window action, or a model: then it is shown on
every screen of this model, whatever the action."""

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Maybe I can add it in ROADMAP if you need a such feature ?

@bealdav
bealdav requested a review from hbrunn October 25, 2026 10:30
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.

6 participants