8000 [18.0][IMP] web_responsive: Quick Record Search by mohammedshahil · Pull Request #3192 · OCA/web · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[18.0][IMP] web_responsive: Quick Record Search #3192

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

Open
wants to merge 1 commit into
base: 18.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions web_responsive/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Web Responsive
==============

..
..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
Expand Down Expand Up @@ -181,6 +181,8 @@ Contributors

- Mohamed Alkobrosli <malkobrosly@kencove.com>

- Mohammed Shahil <mohammedshahilmp@gmail.com>

Maintainers
-----------

Expand All @@ -203,7 +205,7 @@ promote its widespread use.

Current `maintainers <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-Tardo| |maintainer-SplashS|
|maintainer-Tardo| |maintainer-SplashS|

This module is part of the `OCA/web <https://github.com/OCA/web/tree/18.0/web_responsive>`_ project on GitHub.

Expand Down
3 changes: 2 additions & 1 deletion web_responsive/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# Copyright 2021 ITerra - Sergey Shebanin
# Copyright 2023 Onestein - Anjeel Haria
# Copyright 2023 Taras Shabaranskyi
# Copyright 2025 Mohammed Shahil
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).

{
Expand All @@ -12,7 +13,7 @@
"version": "18.0.1.0.0",
"category": "Website",
"website": "https://github.com/OCA/web",
"author": "LasLabs, Tecnativa, ITerra, Onestein, "
"author": "LasLabs, Tecnativa, ITerra, Onestein, mohammedshahil, "
"Odoo Community Association (OCA)",
"license": "LGPL-3",
"installable": True,
Expand Down
4 changes: 4 additions & 0 deletions web_responsive/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,9 @@ <h1 class="title">Web Responsive</h1>
<li><p class="first">Bigger checkboxes in list view</p>
<p><img alt="image5" src="https://raw.githubusercontent.com/OCA/web/18.0/web_responsive/static/img/listview.gif" /></p>
</li>
<li><p class="first">Quick Record Search</p>
<p><img alt="image6" src="https://raw.githubusercontent.com/OCA/web/18.0/web_responsive/static/img/quick_record_search.gif" /></p>
</li>
</ul>
<p><strong>Features for mobile</strong>: * View type picker dropdown displays
comfortably</p>
Expand Down Expand Up @@ -497,6 +500,7 @@ <h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
<li>Taras Shabaranskyi &lt;<a class="reference external" href="mailto:shabaranskij&#64;gmail.com">shabaranskij&#64;gmail.com</a>&gt;</li>
<li>Angel Patel &lt;<a class="reference external" href="mailto:patelangel1414&#64;gmail.com">patelangel1414&#64;gmail.com</a>&gt;</li>
<li>Mohamed Alkobrosli &lt;<a class="reference external" href="mailto:malkobrosly&#64;kencove.com">malkobrosly&#64;kencove.com</a>&gt;</li>
<li>Mohammed Shahil &lt;<a class="reference external" href="mailto:mohammedshahilmp&#64;gmail.com">mohammedshahilmp&#64;gmail.com</a>&gt;</li>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is auto-generated. Please modify the CONTRIBUTORS file instead. Check the example here.

< 8000 form class="mt-2 js-comment-update" data-type="json" data-turbo="false" action="/OCA/web/pull/3192/review_comment/2136391558" accept-charset="UTF-8" method="post">

</ul>
</div>
<div class="section" id="maintainers">
Expand Down
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's really good that you have added a screenshot! Please update the USAGE file and add the description of how this feature works in it. You can also embed this gif in it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ivs-cetmix check my comment about the convenience of this feature being here: #3192 (comment)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ivs-cetmix check my comment about the convenience of this feature being here: #3192 (comment)

@pedrobaeza yup, that makes sense. I see two options:

  • Make search in the same search string that is used now to search for apps (main screen). Then we need to update the web_responsive
  • Leave it "as is". In this case yes, this should be a separate module.

@mohammedshahil what do you think?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ivs-cetmix check my comment about the convenience of this feature being here: #3192 (comment)

@pedrobaeza yup, that makes sense. I see two options:

* Make search in the same search string that is used now to search for apps (main screen). Then we need to update the web_responsive

* Leave it "as is". In this case yes, this should be a separate module.

@mohammedshahil what do you think?

yes separate module is better

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/**
* Command Palette Record Search Provider
*/
import { registry } from "@web/core/registry";
import { DefaultCommandItem } from "@web/core/commands/command_palette";

const commandProviderRegistry = registry.category("command_provider");

commandProviderRegistry.add("record_search", {
namespace: "/",
async provide(env, options = {}) {
const searchValue = options.searchValue || "";
const match = searchValue.match(/^([\w\.]+)(?:\s+(.*))?$/);
if (!match) {
return [];
}
const model = match[1];
const term = (match[2] || "").trim();
let results = [];
try {
results = await env.services.orm.searchRead(
model,
[["display_name", "ilike", term]],
["id", "display_name"],
{ limit: 10 }
);
} catch (e) {
return [];
}
return results.map((rec) => ({
Component: DefaultCommandItem,
action: () => {
env.services.action.doAction({
type: "ir.actions.act_window",
res_model: model,
res_id: rec.id,
view_mode: "form",
views: [[false, "form"]],
target: "current",
});
},
category: "default",
name: rec.display_name,
}));
},
});
Loading
0