-
-
Notifications
You must be signed in to change notification settings - Fork 543
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[16.0] [ADD] multisearch_field #967
base: 16.0
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work ! thanks for sharing.
some minor remarks inline. Otherwise, LGTM.
@@ -0,0 +1,6 @@ | |||
To configure the separator you must: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better to put this part in a CONFIGURE.rst section.
In the USAGE file you can put a print screen. (something like "before" / "after").
@@ -0,0 +1 @@ | |||
* This module allows mulit_searching for all search. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you elaborate the description ? say exactly what the modules does.
(there are some base_search_xxx module in the OCA, like base_name_search_improved, base_search_fuzzy, etc...)
else: | ||
domain_list.append(dom) | ||
for _ in range(nbr): | ||
domain_list.append("|") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can manipulate all the domain with expression.OR and expression.AND. It will be more readable I think.
@@ -0,0 +1,15 @@ | |||
{ | |||
"name": "MultiSearch", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
too generic title in my opinion.
Thanks @TB-Ph35 for this contribution. Regarding the module name, it's not an easy topic, isn't it? What the module does, if I understood correctly, is to allow searching for multiple values of a particular field.
To make this understandable with the module name, some candidates could be:
another suggestion? |
FYI, my remarks regarding the name was about the value "name" in the manifest, not the technical name. |
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. |
@@ -0,0 +1,15 @@ | |||
{ | |||
"name": "Field MultiSearch with separotor", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"name": "Field MultiSearch with separotor", | |
"name": "Field MultiSearch with separator", |
typo.
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. |
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 :
if i don't understand it wrong |
The search with space work fine now with / before the search. Thank you @TB-Ph35 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Functionnal review OK
6a6f4c0
to
1fac86e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job Thomas, really useful module, some typo comments here.
Could you crop your images to focus on parts without white page color to see that you want to show.
Probably squash commits could be nice
Thanks a lot.
This module allows mulit_searching for all search. | ||
For that, it add code before the search function. | ||
|
||
It will allows you to search for multi_value separate by the character that you |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will allows you to search for multi_value separate by the character that you | |
It will allow you to search for multiple values separated by the character you |
For that, it add code before the search function. | ||
|
||
It will allows you to search for multi_value separate by the character that you | ||
have configure. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
have configure. | |
have configured. |
@@ -0,0 +1,6 @@ | |||
<odoo noupdate="1"> | |||
<record id="multi_search_separator" model="ir.config_parameter"> | |||
<field name="key">multi_search_separator_base</field> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<field name="key">multi_search_separator_base</field> | |
<field name="key">multi_search_separator</field> |
multisearch_field/monkeypatching.py
Outdated
fields""" | ||
if self.env["ir.model.access"].check_access_rights("read", raise_exception=False): | ||
list_separator = self.env["ir.config_parameter"].get_param( | ||
"multi_search_separator_base" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"multi_search_separator_base" | |
"multi_search_separator" |
To configure the separator you must: | ||
* be in dev_mode | ||
* go to Settings / technical / system parameter | ||
* search multi_search_separator_base |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* search multi_search_separator_base | |
* search multi_search_separator |
|
||
class TestMultisearch(TransactionCase): | ||
def setUp(self): | ||
super(TestMultisearch, self).setUp() |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
1fac86e
to
42d551e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thanks a lot
This PR has the |
This module add multi-searching with separator for all search.
It add to model.search() code to enable searching with separator.
example: