-
-
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]17.0-mig-web_search_with_and #2876
base: 17.0
Are you sure you want to change the base?
Conversation
Add README.rst Too short underline for module title in README.rst Improving module meta information Version 1.0 W391 blank line at end of file Remove module description because README.rst is there web_search_with_and: Latest OCA conventions
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: web-16.0/web-16.0-web_search_with_and Translate-URL: https://translation.odoo-community.org/projects/web-16-0/web-16-0-web_search_with_and/
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.
Technical review LGTM
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.
successfully tested on runboat
This PR has the |
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.
Functiona review OK !!
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.
LGTM - Code review and tested
The history could be squashed on several commits.
https://github.com/OCA/maintainer-tools/wiki/Merge-commits-in-pull-requests#mergesquash-the-commits-generated-by-bots-or-weblate
import {SearchBar} from "@web/search/search_bar/search_bar"; | ||
|
||
patch(SearchBar.prototype, { | ||
selectItem(item) { |
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 method seems to have changed in Odoo 17: https://github.com/odoo/odoo/blob/f1f8cbf/addons/web/static/src/search/search_bar/search_bar.js#L341-L348
Given that the method is overwritten without calling super, you'd have to incorporate the new code in this module.
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.
@jcadhoc I think you need to change this, because in Odoo 16 the method looked like this:
selectItem(item) {
if (!item.unselectable) {
const { searchItemId, label, operator, value } = item;
this.env.searchModel.addAutoCompletionValues(searchItemId, { label, operator, value });
}
this.resetState();
}
And in this module this parameter was added: isShiftKey: this.isShiftKey to the addAutoCompletionValues call.
And because in Odoo 17 the method is like this:
selectItem(item) {
const searchItem = this.getSearchItem(item.searchItemId);
if (
(searchItem.type === "field" && searchItem.fieldType === "properties") ||
(searchItem.type === "field_property" && item.unselectable)
) {
this.toggleItem(item, !item.isExpanded);
return;
}
if (!item.unselectable) {
const { searchItemId, label, operator, value } = item;
this.env.searchModel.addAutoCompletionValues(searchItemId, { label, operator, value });
}
this.resetState();
}
You need to replace the method with the new code and add the isShiftKey: this.isShiftKey to the addAutoCompletionValues call.
In general overwriting methods without calling super is problematic, but in this case I do not have a better solution. But I am also not a Odoo JS expert.
@jcadhoc are you still working on this? |
i`m available again, thanks @CRogos. @StefanRijnhart Hi Stefan! You mean literally copy and paste that code you shared? |
Well, that depends on whether it affects the functionality of this module. |
No description provided.