-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[MIG][REF] web_advanced_search: Rename, refactor, migrate #999
Conversation
bbf2f36
to
22b020c
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.
Functionally, the only problem I find is with the resulting filter label, putting the technical domain. Isn't any way to put a text description of the filter like in previous versions happen?
web_advanced_search/__manifest__.py
Outdated
@@ -0,0 +1,27 @@ | |||
# -*- coding: utf-8 -*- | |||
# Copyright 2015 Therp BV <http://therp.nl> | |||
# Copyright 2017 Tecnativa - Vicent Cubells |
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.
Add your copyright here
@@ -0,0 +1,283 @@ | |||
/* Copyright 2015 Therp BV <http://therp.nl> |
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.
Rename file according module renaming
web_advanced_search/__init__.py
Outdated
@@ -0,0 +1,3 @@ | |||
# -*- coding: utf-8 -*- |
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.
Remove coding
web_advanced_search/__manifest__.py
Outdated
@@ -0,0 +1,27 @@ | |||
# -*- coding: utf-8 -*- |
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.
Remove coding
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.
some details.
Simple tests OK
web_advanced_search/README.rst
Outdated
Search for x2x records in advanced search | ||
========================================= | ||
|
||
Standard behavior in advanced search for one2many, many2many and many2one fields is to do a `name_search`. This often is not satisfactionary as you might want to search for other properties. There might also be cases where you don't exactly know what you're searching for, then a list of possible options is necessary too. This module enables you to have a full search view to select the record in question, and either select specific records or select them using a search query of its own. |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
web_advanced_search/README.rst
Outdated
|
||
To use this module, you need to: | ||
|
||
* open the advanced search options in a search view |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
web_advanced_search/README.rst
Outdated
|
||
To search for properties of linked records (ie invoices for customers with a credit limit higher than X): | ||
|
||
* open the advanced search options in a search view |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
web_advanced_search/README.rst
Outdated
Known issues / Roadmap | ||
====================== | ||
|
||
* When you use *is in selection* search system and choose a domain, it gets |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
web_advanced_search/__manifest__.py
Outdated
"qweb": [ | ||
'static/src/xml/web_advanced_search.xml', | ||
], | ||
"auto_install": False, |
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.
no need for the keys with the default values no?
@@ -0,0 +1,13 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<!-- Copyright 2017 Jairo Llopis <jairo.llopis@tecnativa.com> |
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.
update the date
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.
Functionally, the only problem I find is with the resulting filter label, putting the technical domain. Isn't any way to put a text description of the filter like in previous versions happen?
Yes, it's in the known issues. We'd need a tool to translate a domain to a human-readable format, which should possibly be upstream, either in odoo itself, or in the module that extends the domain widget, and then used downstream in this addon.
It doesn't seem as a blocker anyway, isn't it? 😇
web_advanced_search/README.rst
Outdated
Search for x2x records in advanced search | ||
========================================= | ||
|
||
Standard behavior in advanced search for one2many, many2many and many2one fields is to do a `name_search`. This often is not satisfactionary as you might want to search for other properties. There might also be cases where you don't exactly know what you're searching for, then a list of possible options is necessary too. This module enables you to have a full search view to select the record in question, and either select specific records or select them using a search query of its own. |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
web_advanced_search/README.rst
Outdated
|
||
To use this module, you need to: | ||
|
||
* open the advanced search options in a search view |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
web_advanced_search/README.rst
Outdated
|
||
To search for properties of linked records (ie invoices for customers with a credit limit higher than X): | ||
|
||
* open the advanced search options in a search view |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
web_advanced_search/README.rst
Outdated
Known issues / Roadmap | ||
====================== | ||
|
||
* When you use *is in selection* search system and choose a domain, it gets |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
web_advanced_search/__manifest__.py
Outdated
], | ||
'installable': True, | ||
"application": False, | ||
} |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
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.
code & functional review: LG.
Small things I'd change but not mandatory.
Tested on runbot: the "search more" is a bit glitchy as it closes the filter dropdown but it's something we can live with. Worth to drop a line in roadmap?
|
||
init: function () { | ||
this._super.apply(this, arguments); | ||
// To make widgets work, we need to a model and an empty record |
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.
*to add
/** | ||
* A search field for relational fields. | ||
* | ||
* It implements and extends the `FieldManagerMixing`, and acts as if it |
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.
*Mixin
} | ||
}); | ||
// Create dummy record with only the field the user is searching | ||
var params = { |
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'd move this to a separated function
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 have left this as it was. Thinking about it, it's only done once at init time, and calling it again could produce some problems, so it seems legit to not do a method about it IMHO.
I fixed your other comments though.
WIP until I include fixes for @simahawk's suggestions and I backport human-readable search string generator from odoo/odoo#25922.
That's something that I actually like, because when hitting "apply", you don't have to apply it again. What's the problem on that? 🤔 |
Nice, we have now human-readable leaf strings for advanced searches. I was expecting odoo/odoo#25922 to get merged faster and me being able to backport it to OCB, but whatever. It's here in the addon now. If other addons require this system, it could be split in a separate addon, but I think this is a good approach to keep it simple for now, when that's not happening. |
Yes. |
76139cf
to
3226b4c
Compare
Merged in e764017 |
Why manifest.py became openerp.py after merging? |
😕 weird... |
Mea culpa, I screwed up on the squashing. Fixing directly. |
@Tecnativa