-
-
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
[ADD][web_widget_domain_v11] Domain widget backport #672
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.
This module deserves a better icon, like this one:
There's also a problem on advanced search, because the view is very short, so is there a way to expand the size of the popup when selecting "is in selection"? If not, expand it for all the cases at least:
Please change also the web_advanced_search_x2x README according the changes, and bump its version to 10.0.2.0.0, as it's a big change.
web_widget_domain_v11/README.rst
Outdated
|
||
To use this module, you need to: | ||
|
||
#. Install any addon that makes use of the domain widget (i.e. |
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.
Instead of this, for being auto-testable, we are going to make the following: change the widget of the domain field of ir.filters. This way, we get that functionality which is very great in this case, and we can test it directly
web_widget_domain_v11/README.rst
Outdated
====================== | ||
|
||
* This addon replaces the built-in ``char_domain`` widget, so it can break | ||
compatibility with other addons that use 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.
add also / extend it
@@ -0,0 +1,47 @@ | |||
odoo.define("web.DomainSelectorDialog", function (require) { |
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.
Are these files needed?
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.
There are thousands of JS lines needed. I just copy-pasted all those involved and made sure there was no module name conflict, but honestly I'd prefer not to have to look deeply into each one of them since the life span of this module is going to be so short (just 1 version).
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.
OK, I was talking about the suspicious name copied-js
, that it seems to work like a copied-pasted version for references, but not the final JS.
One last thing: translations! |
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's so great to have this! 😃
Besides @pedrobaeza comments, I found strange not to be able to use the classic domain filtering like here:
Is it on purpose or am I missing something?
good job guys :) |
It should be ready now. |
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.
eyeball code review: ok.
functional test: ok.
The only glitch I find is that when you use the widget in a popup (from a related field for instance) the dropdown is cut where the popup ends. But I think this is an issue on the original implementation. Thanks for the port!
@simahawk If you can guide me to get to that, I can look at it. 😉 What steps did you follow? Thanks |
@yajo this is it:
so that is fight of scrolling because you have to scroll both on the popup and inside the dropdown of the widget. If I open B form straight (not in a popup) it works smoothly. |
@simahawk OK I checked it, but it seems like it's good as it is. On one hand I wouldn't know how to properly fix it right now (it's got the proper z-index already AFAICS), but OTOH how would you scroll the main window if there were a modal inside? Just scroll the modal and you can use it as usual, don't you? |
@yajo I know. I was not complaining I was just pointing out the issue 😄 Nevertheless if the modal is not that high scrolling is really a pain. The real issue comes not from z-index but from the modal hiding overflow. A simple (?) fix could be: when the dropdown is shown it sets
on the closest modal? Just tried on the fly and it works. Not sure if it has side effects. |
I tested live with your example code, and the problem is that now the modal does not fit into the screen if it is too big. You can try on current runbot here pressing edit and then on bank_ids for example. It turns out somebody already hit this problem, and the new problem from your solution, but still I tested that and it does not seem to work in Odoo, so not sure what else to do. It seems this comment nails it, but I don't want to do that, honestly. 😅 |
np, we can live with it ATM ;) |
One last thing, @yajo: can we have inside the widget domain also the possibility to select the many2one value when the operator is "equal" or "not equal" the same as we have it on the "simple search"? |
I think that would be a little bit tricky to achieve. Besides, you already have the normal "[not ]equal" filter for that, and I'd prefer not to diverge too much from upstream's domain widget to be able to completely get rid of |
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.
OK, it's something that we are losing from previous implementation, but we win a lot of other things, so let's merge this.
- Most code directly copied from upstream Odoo, in the commit before the JS refactor that took place in master. - Some little glue code to make it replace v10's widget.
7e06c5c
to
2cc0d8d
Compare
Below, screenshot of mass mailing addon with this addon installed along with it. Read mode:
Edit mode:
@Tecnativa