server-ux icon indicating copy to clipboard operation
server-ux copied to clipboard

[16.0] [ADD] multisearch_field

Open TB-Ph35 opened this issue 1 year ago • 8 comments

This module add multi-searching with separator for all search.

It add to model.search() code to enable searching with separator. example:

  1. you are searching "Tom|kelly;hart"
  2. If the separator are "|" and ";"
  3. it will search for "Tom|kelly;hart", "Tom|kelly", "Tom", "kelly;hart", "kelly" and "hart"

TB-Ph35 avatar Nov 07 '24 07:11 TB-Ph35

Thanks @TB-Ph35 for this contribution.

Regarding the module name, it's not an easy topic, isn't it? If we want to make the name meaningful, we need to add meaningful terms and remove some. I guess base_ doesn't help to understand what the module does.

What the module does, if I understood correctly, is to allow searching for multiple values ​​of a particular field.

separator is the way to do it, not what it does

To make this understandable with the module name, some candidates could be:

  • field_multisearch
  • multisearch_field

another suggestion?

bealdav avatar Nov 07 '24 12:11 bealdav

FYI, my remarks regarding the name was about the value "name" in the manifest, not the technical name.

legalsylvain avatar Nov 07 '24 12:11 legalsylvain

Thanks for all the comment.

With those comment, i have made changes. But not the names module. It is not easy like you said, and that's really not my game. I will think about it.

TB-Ph35 avatar Nov 07 '24 13:11 TB-Ph35

LGTM. Thank you for your work, Thomas.

I tried on the Customer Invoice by doing a search with:

Just one remark: once we want to copy and paste several lines from an XLS sheet, we don't have a separator, but only a space. So in that case, we have to add the separator and remove the space before copying to make the search work. Capture d’écran 2024-11-07 à 15 24 03 It could be very interesting to have the space consideration in the search, or even as a separator itself.

PaulGoubert avatar Nov 07 '24 14:11 PaulGoubert

Concerning the name, for my point of view, the main thing is to have multisearch in the module name. Then as @bealdav mentionned, field_multisearch or multisearch_field look good for me.

If the Space is concidered as a "separator", the name separator is not required in the module name.

PaulGoubert avatar Nov 07 '24 15:11 PaulGoubert

I will look for adding the space. But now it can be add to the list of separator because for some search it broke the search. Like for self.env["resource.calendat.leaves"]. It split datetimeformat and that make this error :

psycopg2.errors.InvalidDatetimeFormat: invalid input syntax for type timestamp: "16:23:06" LINE 1: ...')) OR ("resource_calendar_leaves"."date_from" <= '16:23:06'...

if i don't understand it wrong

TB-Ph35 avatar Nov 07 '24 15:11 TB-Ph35

The search with space work fine now with / before the search. For product for ex : /E-COM06 E-COM07 E-COM08

Thank you @TB-Ph35

PaulGoubert avatar Nov 12 '24 08:11 PaulGoubert

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

OCA-git-bot avatar Nov 14 '24 17:11 OCA-git-bot

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

github-actions[bot] avatar Oct 05 '25 12:10 github-actions[bot]

@legalsylvain could you approve or review again ? Thanks

bealdav avatar Oct 08 '25 08:10 bealdav

It's up to @sebastienbeau !

legalsylvain avatar Oct 08 '25 08:10 legalsylvain

/ocabot merge nobump

sebastienbeau avatar Oct 23 '25 09:10 sebastienbeau

On my way to merge this fine PR! Prepared branch 16.0-ocabot-merge-pr-967-by-sebastienbeau-bump-nobump, awaiting test results.

OCA-git-bot avatar Oct 23 '25 09:10 OCA-git-bot

Congratulations, your PR was merged at 9e0c1afe409a05a9d53a1bb128f2d7bd6220c23a. Thanks a lot for contributing to OCA. ❤️

OCA-git-bot avatar Oct 23 '25 09:10 OCA-git-bot