diff --git a/sh_global_search/.idea/inspectionProfiles/Project_Default.xml b/sh_global_search/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 00000000..33ce94b8 --- /dev/null +++ b/sh_global_search/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,22 @@ + + + + \ No newline at end of file diff --git a/sh_global_search/.idea/inspectionProfiles/profiles_settings.xml b/sh_global_search/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 00000000..105ce2da --- /dev/null +++ b/sh_global_search/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/sh_global_search/.idea/modules.xml b/sh_global_search/.idea/modules.xml new file mode 100644 index 00000000..39a7ae13 --- /dev/null +++ b/sh_global_search/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/sh_global_search/.idea/sh_global_search.iml b/sh_global_search/.idea/sh_global_search.iml new file mode 100644 index 00000000..d0876a78 --- /dev/null +++ b/sh_global_search/.idea/sh_global_search.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/sh_global_search/README.md b/sh_global_search/README.md new file mode 100644 index 00000000..a89328e9 --- /dev/null +++ b/sh_global_search/README.md @@ -0,0 +1,26 @@ +About +============ +A global search used to search any object based on the configuration. You can search all object's data easily. You can also configure one to many fields. The "Global Search" is visible to all odoo users. The search box is available at the top of the menu. Search results on click redirect to that record on the new tab. You can easily perform a search on multi-company objects also we have beautifully show company name before so you can see search results related to that company, we have show object (model) nicely whenever you have search query found in multiple objects, you can very easily see the difference of different objects. It also takes care of access rights of users, if a user doesn't have any object access than it will not show that record in search results. if the user has multi-company enabled than it shows multi-company results. We have made this looks fully configurable you can easily configure what is an important object(model) and related fields of that object(model), We have made security groups for this configurations so only who have right that user only can configure this global search objects and fields, All internal users can use this global search feature. Cheers! + +User Guide +============ +Blog: https://www.softhealer.com/blog/odoo-2/post/global-search-531 + +Installation +============ +1) Copy module files to addon folder. +2) Restart odoo service (sudo service odoo-server restart). +3) Go to your odoo instance and open apps (make sure to activate debug mode). +4) click on update app list. +5) search module name and hit install button. + +Any Problem with module? +===================================== +Please create your ticket here https://softhealer.com/support + +Softhealer Technologies Doubt/Inquiry/Sales/Customization Team +===================================== +Skype: live:softhealertechnologies +What's app: +917984575681 +E-Mail: support@softhealer.com +Website: https://softhealer.com diff --git a/sh_global_search/__init__.py b/sh_global_search/__init__.py new file mode 100644 index 00000000..9b547c5e --- /dev/null +++ b/sh_global_search/__init__.py @@ -0,0 +1,3 @@ +# Copyright (C) Softhealer Technologies. + +from . import models diff --git a/sh_global_search/__manifest__.py b/sh_global_search/__manifest__.py new file mode 100644 index 00000000..54f88288 --- /dev/null +++ b/sh_global_search/__manifest__.py @@ -0,0 +1,45 @@ +# Part of Softhealer Technologies. +{ + "name": "机企猫 全局扫码搜索", + + "author": "Softhealer Technologies", + + "website": "https://www.softhealer.com", + + "version": "16.0.1", + + "license": "OPL-1", + + "support": "support@softhealer.com", + + "category": "Extra Tools", + + "summary": "any data search,Easy Object Search,Quick Object Find Module, advance search,Object Using Attributes,Overall Odoo Object Search,Global Model Search,advance records search,google search,Feeds search,all in one search,search option Odoo", + + "description": """ +A global search used to search any object based on the configuration. You can search all object's data easily. You can also configure one to many fields. The "Global Search" is visible to all odoo users. The search box is available at the top of the menu. Search results on click redirect to that record on the new tab. You can easily perform a search on multi-company objects also we have beautifully show company name before so you can see search results related to that company, we have show object (model) nicely whenever you have search query found in multiple objects, you can very easily see the difference of different objects. It also takes care of access rights of users, if a user doesn't have any object access than it will not show that record in search results. if the user has multi-company enabled than it shows multi-company results. We have made this looks fully configurable you can easily configure what is an important object(model) and related fields of that object(model), We have made security groups for this configurations so only who have right that user only can configure this global search objects and fields, All internal users can use this global search feature. Cheers!""", + + "depends": ['base_setup', 'web'], + + "data": [ + "security/base_security.xml", + "security/ir.model.access.csv", + "views/global_search_view.xml", + ], + 'assets': { + + 'web.assets_backend': [ + 'sh_global_search/static/src/scss/GlobalSearch.scss', + 'sh_global_search/static/src/xml/*.xml', + 'sh_global_search/static/src/js/*', + ] + }, + + "images": ["static/description/background.png", ], + "live_test_url": "https://youtu.be/rbkWI9j0XN0", + "installable": True, + "auto_install": False, + "application": True, + "price": 40, + "currency": "EUR" +} diff --git a/sh_global_search/doc/changelog.rst b/sh_global_search/doc/changelog.rst new file mode 100644 index 00000000..88e29e46 --- /dev/null +++ b/sh_global_search/doc/changelog.rst @@ -0,0 +1,9 @@ +16.0.1 (26 Sept 2022) +------------------ + +- initial release + + (8th Nov 2022) +--------------------- + +- fixed multiple display issue diff --git a/sh_global_search/i18n/ar.po b/sh_global_search/i18n/ar.po new file mode 100644 index 00000000..8f8ce6e8 --- /dev/null +++ b/sh_global_search/i18n/ar.po @@ -0,0 +1,240 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * sh_global_search +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.1alpha1\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2020-09-28 10:52+0000\n" +"PO-Revision-Date: 2020-09-28 10:52+0000\n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search__model_id +msgid "Applies To" +msgstr "ينطبق على" + +#. module: sh_global_search +#: model:ir.model,name:sh_global_search.model_res_company +msgid "Companies" +msgstr "الشركات" + +#. module: sh_global_search +#: model:ir.model,name:sh_global_search.model_res_config_settings +msgid "Config Settings" +msgstr "إعدادات التكوين" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search__create_uid +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__create_uid +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields__create_uid +msgid "Created by" +msgstr "انشأ من قبل" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search__create_date +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__create_date +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields__create_date +msgid "Created on" +msgstr "تم إنشاؤها على" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search__display_name +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__display_name +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields__display_name +#: model:ir.model.fields,field_description:sh_global_search.field_res_company__display_name +#: model:ir.model.fields,field_description:sh_global_search.field_res_config_settings__display_name +msgid "Display Name" +msgstr "اسم العرض" + +#. module: sh_global_search +#: model_terms:ir.ui.view,arch_db:sh_global_search.sh_enable_menu_search_res_config_settings +msgid "Enable Global Menu Search" +msgstr "تمكين البحث في القائمة العالمية" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_res_company__enable_menu_search +#: model:ir.model.fields,field_description:sh_global_search.field_res_config_settings__enable_menu_search +msgid "Enable Menu Global Search" +msgstr "تمكين قائمة البحث الشامل" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__ttype +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields__ttype +msgid "Field Type" +msgstr "نوع الحقل" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search__field_ids +#: model:ir.model.fields,field_description:sh_global_search.field_global_search__global_field_ids +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__field_ids +#: model_terms:ir.ui.view,arch_db:sh_global_search.sh_m2o_global_search_form +#: model_terms:ir.ui.view,arch_db:sh_global_search.sh_o2m_dynamic_action_form +#: model_terms:ir.ui.view,arch_db:sh_global_search.sh_o2m_global_search_form +msgid "Fields" +msgstr "مجالات" + +#. module: sh_global_search +#: model:ir.model.fields,help:sh_global_search.field_global_search_fields__related_model_id +#: model:ir.model.fields,help:sh_global_search.field_o2m_global_search_fields__related_model_id +msgid "For relationship fields, the technical name of the target model" +msgstr "بالنسبة لحقول العلاقة ، الاسم التقني للنموذج الهدف" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields__global_o2m_search_id +msgid "Global O2M Search" +msgstr "بحث O2M العالمي" + +#. module: sh_global_search +#: model_terms:ir.ui.view,arch_db:sh_global_search.sh_dynamic_action_tree +msgid "Global Search" +msgstr "البحث العالمي" + +#. module: sh_global_search +#: model:ir.actions.act_window,name:sh_global_search.sh_dynamic_action_action +#: model:ir.ui.menu,name:sh_global_search.sh_dynamic_action_action_menu +#: model_terms:ir.ui.view,arch_db:sh_global_search.sh_o2m_dynamic_action_form +msgid "Global Search Configuration" +msgstr "تكوين البحث العالمي" + +#. module: sh_global_search +#: model_terms:ir.ui.view,arch_db:sh_global_search.sh_m2o_global_search_form +msgid "Global Search M2O Action" +msgstr "البحث العالمي M2O العمل" + +#. module: sh_global_search +#: model_terms:ir.ui.view,arch_db:sh_global_search.sh_o2m_global_search_form +msgid "Global Search O2M Action" +msgstr "البحث العالمي O2M العمل" + +#. module: sh_global_search +#: model:ir.model,name:sh_global_search.model_global_search +msgid "Global search" +msgstr "البحث العالمي" + +#. module: sh_global_search +#: model:ir.model,name:sh_global_search.model_global_search_fields +msgid "Global search fields" +msgstr "حقول البحث العالمية" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search__id +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__id +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields__id +#: model:ir.model.fields,field_description:sh_global_search.field_res_company__id +#: model:ir.model.fields,field_description:sh_global_search.field_res_config_settings__id +msgid "ID" +msgstr "هوية شخصية" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__name +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields__name +msgid "Label" +msgstr "ضع الكلمة المناسبة" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search____last_update +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields____last_update +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields____last_update +#: model:ir.model.fields,field_description:sh_global_search.field_res_company____last_update +#: model:ir.model.fields,field_description:sh_global_search.field_res_config_settings____last_update +msgid "Last Modified on" +msgstr "تاريخ آخر تعديل" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search__write_uid +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__write_uid +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields__write_uid +msgid "Last Updated by" +msgstr "آخر تحديث بواسطة" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search__write_date +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__write_date +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields__write_date +msgid "Last Updated on" +msgstr "آخر تحديث في" + +#. module: sh_global_search +#: code:addons/sh_global_search/models/global_search.py:0 +#, python-format +msgid "M2O Object Fields" +msgstr "حقول كائن M2O" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__model_id +msgid "Model" +msgstr "نموذج" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search__main_field_id +msgid "Name Field" +msgstr "حقل الاسم" + +#. module: sh_global_search +#: code:addons/sh_global_search/models/global_search.py:0 +#, python-format +msgid "O2M Object Fields" +msgstr "حقول كائن O2M" + +#. module: sh_global_search +#: model:ir.model,name:sh_global_search.model_o2m_global_search_fields +msgid "O2m Global search fields" +msgstr "حقول البحث العالمية O2m" + +#. module: sh_global_search +#: model_terms:ir.ui.view,arch_db:sh_global_search.sh_o2m_dynamic_action_form +msgid "Open Relation Fields" +msgstr "فتح مجالات العلاقات" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__field_id +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields__field_id +msgid "Position Field" +msgstr "مجال الموقف" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__global_search_id +msgid "Related Model" +msgstr "النموذج ذو الصلة" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__related_model_id +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields__model_id +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields__related_model_id +msgid "Relation With" +msgstr "علاقة مع" + +#. module: sh_global_search +#. openerp-web +#: code:addons/sh_global_search/static/src/xml/apps.xml:0 +#, python-format +msgid "Search ..." +msgstr "بحث ..." + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__sequence +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields__sequence +msgid "Sequence" +msgstr "تسلسل" + +#. module: sh_global_search +#: model:res.groups,name:sh_global_search.group_global_search +msgid "Show Global Search Configuration" +msgstr "إظهار تكوين البحث العالمي" + +#. module: sh_global_search +#: model:ir.model.fields,help:sh_global_search.field_global_search__model_id +msgid "The model this field belongs to" +msgstr "النموذج الذي ينتمي إليه هذا المجال" + +#. module: sh_global_search +#: model:res.groups,comment:sh_global_search.group_global_search +msgid "This user will be able to Show Global Search Configuration" +msgstr "سيتمكن هذا المستخدم من إظهار تكوين البحث العالمي" diff --git a/sh_global_search/i18n/de.po b/sh_global_search/i18n/de.po new file mode 100644 index 00000000..cd2aaed6 --- /dev/null +++ b/sh_global_search/i18n/de.po @@ -0,0 +1,240 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * sh_global_search +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.1alpha1\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2020-09-28 10:52+0000\n" +"PO-Revision-Date: 2020-09-28 10:52+0000\n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search__model_id +msgid "Applies To" +msgstr "Gilt für" + +#. module: sh_global_search +#: model:ir.model,name:sh_global_search.model_res_company +msgid "Companies" +msgstr "Unternehmen" + +#. module: sh_global_search +#: model:ir.model,name:sh_global_search.model_res_config_settings +msgid "Config Settings" +msgstr "Konfigurationseinstellungen" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search__create_uid +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__create_uid +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields__create_uid +msgid "Created by" +msgstr "Erstellt von" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search__create_date +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__create_date +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields__create_date +msgid "Created on" +msgstr "Erstellt am" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search__display_name +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__display_name +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields__display_name +#: model:ir.model.fields,field_description:sh_global_search.field_res_company__display_name +#: model:ir.model.fields,field_description:sh_global_search.field_res_config_settings__display_name +msgid "Display Name" +msgstr "Anzeigename" + +#. module: sh_global_search +#: model_terms:ir.ui.view,arch_db:sh_global_search.sh_enable_menu_search_res_config_settings +msgid "Enable Global Menu Search" +msgstr "Aktivieren Sie die globale Menüsuche" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_res_company__enable_menu_search +#: model:ir.model.fields,field_description:sh_global_search.field_res_config_settings__enable_menu_search +msgid "Enable Menu Global Search" +msgstr "Menü Globale Suche aktivieren" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__ttype +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields__ttype +msgid "Field Type" +msgstr "Feldtyp" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search__field_ids +#: model:ir.model.fields,field_description:sh_global_search.field_global_search__global_field_ids +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__field_ids +#: model_terms:ir.ui.view,arch_db:sh_global_search.sh_m2o_global_search_form +#: model_terms:ir.ui.view,arch_db:sh_global_search.sh_o2m_dynamic_action_form +#: model_terms:ir.ui.view,arch_db:sh_global_search.sh_o2m_global_search_form +msgid "Fields" +msgstr "Felder" + +#. module: sh_global_search +#: model:ir.model.fields,help:sh_global_search.field_global_search_fields__related_model_id +#: model:ir.model.fields,help:sh_global_search.field_o2m_global_search_fields__related_model_id +msgid "For relationship fields, the technical name of the target model" +msgstr "Für Beziehungsfelder der technische Name des Zielmodells" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields__global_o2m_search_id +msgid "Global O2M Search" +msgstr "Globale O2M-Suche" + +#. module: sh_global_search +#: model_terms:ir.ui.view,arch_db:sh_global_search.sh_dynamic_action_tree +msgid "Global Search" +msgstr "Globale Suche" + +#. module: sh_global_search +#: model:ir.actions.act_window,name:sh_global_search.sh_dynamic_action_action +#: model:ir.ui.menu,name:sh_global_search.sh_dynamic_action_action_menu +#: model_terms:ir.ui.view,arch_db:sh_global_search.sh_o2m_dynamic_action_form +msgid "Global Search Configuration" +msgstr "Globale Suchkonfiguration" + +#. module: sh_global_search +#: model_terms:ir.ui.view,arch_db:sh_global_search.sh_m2o_global_search_form +msgid "Global Search M2O Action" +msgstr "Globale Suche M2O-Aktion" + +#. module: sh_global_search +#: model_terms:ir.ui.view,arch_db:sh_global_search.sh_o2m_global_search_form +msgid "Global Search O2M Action" +msgstr "Globale Suche O2M-Aktion" + +#. module: sh_global_search +#: model:ir.model,name:sh_global_search.model_global_search +msgid "Global search" +msgstr "Globale Suche" + +#. module: sh_global_search +#: model:ir.model,name:sh_global_search.model_global_search_fields +msgid "Global search fields" +msgstr "Globale Suchfelder" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search__id +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__id +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields__id +#: model:ir.model.fields,field_description:sh_global_search.field_res_company__id +#: model:ir.model.fields,field_description:sh_global_search.field_res_config_settings__id +msgid "ID" +msgstr "ICH WÜRDE" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__name +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields__name +msgid "Label" +msgstr "Etikette" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search____last_update +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields____last_update +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields____last_update +#: model:ir.model.fields,field_description:sh_global_search.field_res_company____last_update +#: model:ir.model.fields,field_description:sh_global_search.field_res_config_settings____last_update +msgid "Last Modified on" +msgstr "Zuletzt geändert am" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search__write_uid +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__write_uid +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields__write_uid +msgid "Last Updated by" +msgstr "Zuletzt aktualisiert von" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search__write_date +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__write_date +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields__write_date +msgid "Last Updated on" +msgstr "Zuletzt aktualisiert am" + +#. module: sh_global_search +#: code:addons/sh_global_search/models/global_search.py:0 +#, python-format +msgid "M2O Object Fields" +msgstr "M2O-Objektfelder" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__model_id +msgid "Model" +msgstr "Modell" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search__main_field_id +msgid "Name Field" +msgstr "Namensfeld" + +#. module: sh_global_search +#: code:addons/sh_global_search/models/global_search.py:0 +#, python-format +msgid "O2M Object Fields" +msgstr "O2M-Objektfelder" + +#. module: sh_global_search +#: model:ir.model,name:sh_global_search.model_o2m_global_search_fields +msgid "O2m Global search fields" +msgstr "O2m Globale Suchfelder" + +#. module: sh_global_search +#: model_terms:ir.ui.view,arch_db:sh_global_search.sh_o2m_dynamic_action_form +msgid "Open Relation Fields" +msgstr "Beziehungsfelder öffnen" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__field_id +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields__field_id +msgid "Position Field" +msgstr "Positionsfeld" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__global_search_id +msgid "Related Model" +msgstr "Verwandte Modell" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__related_model_id +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields__model_id +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields__related_model_id +msgid "Relation With" +msgstr "Beziehung mit" + +#. module: sh_global_search +#. openerp-web +#: code:addons/sh_global_search/static/src/xml/apps.xml:0 +#, python-format +msgid "Search ..." +msgstr "Suche ..." + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__sequence +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields__sequence +msgid "Sequence" +msgstr "Reihenfolge" + +#. module: sh_global_search +#: model:res.groups,name:sh_global_search.group_global_search +msgid "Show Global Search Configuration" +msgstr "Globale Suchkonfiguration anzeigen" + +#. module: sh_global_search +#: model:ir.model.fields,help:sh_global_search.field_global_search__model_id +msgid "The model this field belongs to" +msgstr "Das Modell, zu dem dieses Feld gehört" + +#. module: sh_global_search +#: model:res.groups,comment:sh_global_search.group_global_search +msgid "This user will be able to Show Global Search Configuration" +msgstr "Dieser Benutzer kann die globale Suchkonfiguration anzeigen" diff --git a/sh_global_search/i18n/es.po b/sh_global_search/i18n/es.po new file mode 100644 index 00000000..f0cc0ec9 --- /dev/null +++ b/sh_global_search/i18n/es.po @@ -0,0 +1,240 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * sh_global_search +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.1alpha1\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2020-09-28 10:52+0000\n" +"PO-Revision-Date: 2020-09-28 10:52+0000\n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search__model_id +msgid "Applies To" +msgstr "Se aplica a" + +#. module: sh_global_search +#: model:ir.model,name:sh_global_search.model_res_company +msgid "Companies" +msgstr "Compañías" + +#. module: sh_global_search +#: model:ir.model,name:sh_global_search.model_res_config_settings +msgid "Config Settings" +msgstr "Ajustes de configuración" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search__create_uid +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__create_uid +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields__create_uid +msgid "Created by" +msgstr "Creado por" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search__create_date +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__create_date +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields__create_date +msgid "Created on" +msgstr "Creado en" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search__display_name +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__display_name +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields__display_name +#: model:ir.model.fields,field_description:sh_global_search.field_res_company__display_name +#: model:ir.model.fields,field_description:sh_global_search.field_res_config_settings__display_name +msgid "Display Name" +msgstr "Nombre para mostrar" + +#. module: sh_global_search +#: model_terms:ir.ui.view,arch_db:sh_global_search.sh_enable_menu_search_res_config_settings +msgid "Enable Global Menu Search" +msgstr "Habilitar la búsqueda de menú global" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_res_company__enable_menu_search +#: model:ir.model.fields,field_description:sh_global_search.field_res_config_settings__enable_menu_search +msgid "Enable Menu Global Search" +msgstr "Habilitar la búsqueda global del menú" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__ttype +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields__ttype +msgid "Field Type" +msgstr "Tipo de campo" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search__field_ids +#: model:ir.model.fields,field_description:sh_global_search.field_global_search__global_field_ids +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__field_ids +#: model_terms:ir.ui.view,arch_db:sh_global_search.sh_m2o_global_search_form +#: model_terms:ir.ui.view,arch_db:sh_global_search.sh_o2m_dynamic_action_form +#: model_terms:ir.ui.view,arch_db:sh_global_search.sh_o2m_global_search_form +msgid "Fields" +msgstr "Campos" + +#. module: sh_global_search +#: model:ir.model.fields,help:sh_global_search.field_global_search_fields__related_model_id +#: model:ir.model.fields,help:sh_global_search.field_o2m_global_search_fields__related_model_id +msgid "For relationship fields, the technical name of the target model" +msgstr "Para los campos de relación, el nombre técnico del modelo de destino" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields__global_o2m_search_id +msgid "Global O2M Search" +msgstr "Búsqueda global de O2M" + +#. module: sh_global_search +#: model_terms:ir.ui.view,arch_db:sh_global_search.sh_dynamic_action_tree +msgid "Global Search" +msgstr "Búsqueda global" + +#. module: sh_global_search +#: model:ir.actions.act_window,name:sh_global_search.sh_dynamic_action_action +#: model:ir.ui.menu,name:sh_global_search.sh_dynamic_action_action_menu +#: model_terms:ir.ui.view,arch_db:sh_global_search.sh_o2m_dynamic_action_form +msgid "Global Search Configuration" +msgstr "Configuración de búsqueda global" + +#. module: sh_global_search +#: model_terms:ir.ui.view,arch_db:sh_global_search.sh_m2o_global_search_form +msgid "Global Search M2O Action" +msgstr "Acción M2O de búsqueda global" + +#. module: sh_global_search +#: model_terms:ir.ui.view,arch_db:sh_global_search.sh_o2m_global_search_form +msgid "Global Search O2M Action" +msgstr "Acción O2M de búsqueda global" + +#. module: sh_global_search +#: model:ir.model,name:sh_global_search.model_global_search +msgid "Global search" +msgstr "Búsqueda global" + +#. module: sh_global_search +#: model:ir.model,name:sh_global_search.model_global_search_fields +msgid "Global search fields" +msgstr "Campos de búsqueda global" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search__id +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__id +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields__id +#: model:ir.model.fields,field_description:sh_global_search.field_res_company__id +#: model:ir.model.fields,field_description:sh_global_search.field_res_config_settings__id +msgid "ID" +msgstr "CARNÉ DE IDENTIDAD" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__name +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields__name +msgid "Label" +msgstr "Etiqueta" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search____last_update +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields____last_update +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields____last_update +#: model:ir.model.fields,field_description:sh_global_search.field_res_company____last_update +#: model:ir.model.fields,field_description:sh_global_search.field_res_config_settings____last_update +msgid "Last Modified on" +msgstr "Última modificación el" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search__write_uid +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__write_uid +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields__write_uid +msgid "Last Updated by" +msgstr "Actualizado por última vez por" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search__write_date +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__write_date +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields__write_date +msgid "Last Updated on" +msgstr "Ultima actualización en" + +#. module: sh_global_search +#: code:addons/sh_global_search/models/global_search.py:0 +#, python-format +msgid "M2O Object Fields" +msgstr "Campos de objeto M2O" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__model_id +msgid "Model" +msgstr "Modelo" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search__main_field_id +msgid "Name Field" +msgstr "Campo de nombre" + +#. module: sh_global_search +#: code:addons/sh_global_search/models/global_search.py:0 +#, python-format +msgid "O2M Object Fields" +msgstr "Campos de objeto O2M" + +#. module: sh_global_search +#: model:ir.model,name:sh_global_search.model_o2m_global_search_fields +msgid "O2m Global search fields" +msgstr "Campos de búsqueda global de O2m" + +#. module: sh_global_search +#: model_terms:ir.ui.view,arch_db:sh_global_search.sh_o2m_dynamic_action_form +msgid "Open Relation Fields" +msgstr "Campos de relación abiertos" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__field_id +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields__field_id +msgid "Position Field" +msgstr "Campo de posición" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__global_search_id +msgid "Related Model" +msgstr "Modelo relacionada" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__related_model_id +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields__model_id +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields__related_model_id +msgid "Relation With" +msgstr "Relación con" + +#. module: sh_global_search +#. openerp-web +#: code:addons/sh_global_search/static/src/xml/apps.xml:0 +#, python-format +msgid "Search ..." +msgstr "Buscar ..." + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__sequence +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields__sequence +msgid "Sequence" +msgstr "Secuencia" + +#. module: sh_global_search +#: model:res.groups,name:sh_global_search.group_global_search +msgid "Show Global Search Configuration" +msgstr "Mostrar configuración de búsqueda global" + +#. module: sh_global_search +#: model:ir.model.fields,help:sh_global_search.field_global_search__model_id +msgid "The model this field belongs to" +msgstr "El modelo al que pertenece este campo" + +#. module: sh_global_search +#: model:res.groups,comment:sh_global_search.group_global_search +msgid "This user will be able to Show Global Search Configuration" +msgstr "Este usuario podrá mostrar la configuración de búsqueda global" diff --git a/sh_global_search/i18n/fr.po b/sh_global_search/i18n/fr.po new file mode 100644 index 00000000..34e58377 --- /dev/null +++ b/sh_global_search/i18n/fr.po @@ -0,0 +1,240 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * sh_global_search +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.1alpha1\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2020-09-28 10:52+0000\n" +"PO-Revision-Date: 2020-09-28 10:52+0000\n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search__model_id +msgid "Applies To" +msgstr "S'applique à" + +#. module: sh_global_search +#: model:ir.model,name:sh_global_search.model_res_company +msgid "Companies" +msgstr "Entreprises" + +#. module: sh_global_search +#: model:ir.model,name:sh_global_search.model_res_config_settings +msgid "Config Settings" +msgstr "Paramètres de configuration" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search__create_uid +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__create_uid +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields__create_uid +msgid "Created by" +msgstr "Créé par" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search__create_date +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__create_date +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields__create_date +msgid "Created on" +msgstr "Créé sur" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search__display_name +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__display_name +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields__display_name +#: model:ir.model.fields,field_description:sh_global_search.field_res_company__display_name +#: model:ir.model.fields,field_description:sh_global_search.field_res_config_settings__display_name +msgid "Display Name" +msgstr "Afficher un nom" + +#. module: sh_global_search +#: model_terms:ir.ui.view,arch_db:sh_global_search.sh_enable_menu_search_res_config_settings +msgid "Enable Global Menu Search" +msgstr "Activer la recherche de menu global" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_res_company__enable_menu_search +#: model:ir.model.fields,field_description:sh_global_search.field_res_config_settings__enable_menu_search +msgid "Enable Menu Global Search" +msgstr "Activer la recherche globale dans le menu" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__ttype +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields__ttype +msgid "Field Type" +msgstr "Type de champ" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search__field_ids +#: model:ir.model.fields,field_description:sh_global_search.field_global_search__global_field_ids +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__field_ids +#: model_terms:ir.ui.view,arch_db:sh_global_search.sh_m2o_global_search_form +#: model_terms:ir.ui.view,arch_db:sh_global_search.sh_o2m_dynamic_action_form +#: model_terms:ir.ui.view,arch_db:sh_global_search.sh_o2m_global_search_form +msgid "Fields" +msgstr "Des champs" + +#. module: sh_global_search +#: model:ir.model.fields,help:sh_global_search.field_global_search_fields__related_model_id +#: model:ir.model.fields,help:sh_global_search.field_o2m_global_search_fields__related_model_id +msgid "For relationship fields, the technical name of the target model" +msgstr "Pour les champs de relation, le nom technique du modèle cible" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields__global_o2m_search_id +msgid "Global O2M Search" +msgstr "Recherche globale O2M" + +#. module: sh_global_search +#: model_terms:ir.ui.view,arch_db:sh_global_search.sh_dynamic_action_tree +msgid "Global Search" +msgstr "Recherche globale" + +#. module: sh_global_search +#: model:ir.actions.act_window,name:sh_global_search.sh_dynamic_action_action +#: model:ir.ui.menu,name:sh_global_search.sh_dynamic_action_action_menu +#: model_terms:ir.ui.view,arch_db:sh_global_search.sh_o2m_dynamic_action_form +msgid "Global Search Configuration" +msgstr "Configuration de la recherche globale" + +#. module: sh_global_search +#: model_terms:ir.ui.view,arch_db:sh_global_search.sh_m2o_global_search_form +msgid "Global Search M2O Action" +msgstr "Recherche globale M2O Action" + +#. module: sh_global_search +#: model_terms:ir.ui.view,arch_db:sh_global_search.sh_o2m_global_search_form +msgid "Global Search O2M Action" +msgstr "Action O2M de recherche globale" + +#. module: sh_global_search +#: model:ir.model,name:sh_global_search.model_global_search +msgid "Global search" +msgstr "Recherche globale" + +#. module: sh_global_search +#: model:ir.model,name:sh_global_search.model_global_search_fields +msgid "Global search fields" +msgstr "Champs de recherche globale" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search__id +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__id +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields__id +#: model:ir.model.fields,field_description:sh_global_search.field_res_company__id +#: model:ir.model.fields,field_description:sh_global_search.field_res_config_settings__id +msgid "ID" +msgstr "ID" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__name +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields__name +msgid "Label" +msgstr "Étiqueter" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search____last_update +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields____last_update +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields____last_update +#: model:ir.model.fields,field_description:sh_global_search.field_res_company____last_update +#: model:ir.model.fields,field_description:sh_global_search.field_res_config_settings____last_update +msgid "Last Modified on" +msgstr "Dernière modification le" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search__write_uid +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__write_uid +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields__write_uid +msgid "Last Updated by" +msgstr "Dernière mise à jour par" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search__write_date +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__write_date +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields__write_date +msgid "Last Updated on" +msgstr "Dernière mise à jour le" + +#. module: sh_global_search +#: code:addons/sh_global_search/models/global_search.py:0 +#, python-format +msgid "M2O Object Fields" +msgstr "Champs d'objets M2O" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__model_id +msgid "Model" +msgstr "Modèle" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search__main_field_id +msgid "Name Field" +msgstr "Champ de nom" + +#. module: sh_global_search +#: code:addons/sh_global_search/models/global_search.py:0 +#, python-format +msgid "O2M Object Fields" +msgstr "Champs d'objets O2M" + +#. module: sh_global_search +#: model:ir.model,name:sh_global_search.model_o2m_global_search_fields +msgid "O2m Global search fields" +msgstr "Champs de recherche globaux O2m" + +#. module: sh_global_search +#: model_terms:ir.ui.view,arch_db:sh_global_search.sh_o2m_dynamic_action_form +msgid "Open Relation Fields" +msgstr "Champs de relation ouverts" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__field_id +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields__field_id +msgid "Position Field" +msgstr "Champ de position" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__global_search_id +msgid "Related Model" +msgstr "Modèle associé" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__related_model_id +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields__model_id +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields__related_model_id +msgid "Relation With" +msgstr "Relation avec" + +#. module: sh_global_search +#. openerp-web +#: code:addons/sh_global_search/static/src/xml/apps.xml:0 +#, python-format +msgid "Search ..." +msgstr "Chercher ..." + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__sequence +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields__sequence +msgid "Sequence" +msgstr "Séquence" + +#. module: sh_global_search +#: model:res.groups,name:sh_global_search.group_global_search +msgid "Show Global Search Configuration" +msgstr "Afficher la configuration de recherche globale" + +#. module: sh_global_search +#: model:ir.model.fields,help:sh_global_search.field_global_search__model_id +msgid "The model this field belongs to" +msgstr "Le modèle auquel ce champ appartient" + +#. module: sh_global_search +#: model:res.groups,comment:sh_global_search.group_global_search +msgid "This user will be able to Show Global Search Configuration" +msgstr "Cet utilisateur pourra afficher la configuration de recherche globale" diff --git a/sh_global_search/i18n/zh_HK.po b/sh_global_search/i18n/zh_HK.po new file mode 100644 index 00000000..c707d4e0 --- /dev/null +++ b/sh_global_search/i18n/zh_HK.po @@ -0,0 +1,240 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * sh_global_search +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.1alpha1\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2020-09-28 10:52+0000\n" +"PO-Revision-Date: 2020-09-28 10:52+0000\n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search__model_id +msgid "Applies To" +msgstr "适用于" + +#. module: sh_global_search +#: model:ir.model,name:sh_global_search.model_res_company +msgid "Companies" +msgstr "公司介绍" + +#. module: sh_global_search +#: model:ir.model,name:sh_global_search.model_res_config_settings +msgid "Config Settings" +msgstr "配置设置" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search__create_uid +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__create_uid +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields__create_uid +msgid "Created by" +msgstr "由...制作" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search__create_date +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__create_date +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields__create_date +msgid "Created on" +msgstr "创建于" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search__display_name +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__display_name +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields__display_name +#: model:ir.model.fields,field_description:sh_global_search.field_res_company__display_name +#: model:ir.model.fields,field_description:sh_global_search.field_res_config_settings__display_name +msgid "Display Name" +msgstr "显示名称" + +#. module: sh_global_search +#: model_terms:ir.ui.view,arch_db:sh_global_search.sh_enable_menu_search_res_config_settings +msgid "Enable Global Menu Search" +msgstr "启用全局菜单搜索" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_res_company__enable_menu_search +#: model:ir.model.fields,field_description:sh_global_search.field_res_config_settings__enable_menu_search +msgid "Enable Menu Global Search" +msgstr "启用菜单全局搜索" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__ttype +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields__ttype +msgid "Field Type" +msgstr "栏位类型" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search__field_ids +#: model:ir.model.fields,field_description:sh_global_search.field_global_search__global_field_ids +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__field_ids +#: model_terms:ir.ui.view,arch_db:sh_global_search.sh_m2o_global_search_form +#: model_terms:ir.ui.view,arch_db:sh_global_search.sh_o2m_dynamic_action_form +#: model_terms:ir.ui.view,arch_db:sh_global_search.sh_o2m_global_search_form +msgid "Fields" +msgstr "领域" + +#. module: sh_global_search +#: model:ir.model.fields,help:sh_global_search.field_global_search_fields__related_model_id +#: model:ir.model.fields,help:sh_global_search.field_o2m_global_search_fields__related_model_id +msgid "For relationship fields, the technical name of the target model" +msgstr "对于关系字段,目标模型的技术名称" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields__global_o2m_search_id +msgid "Global O2M Search" +msgstr "全球O2M搜索" + +#. module: sh_global_search +#: model_terms:ir.ui.view,arch_db:sh_global_search.sh_dynamic_action_tree +msgid "Global Search" +msgstr "全球搜寻" + +#. module: sh_global_search +#: model:ir.actions.act_window,name:sh_global_search.sh_dynamic_action_action +#: model:ir.ui.menu,name:sh_global_search.sh_dynamic_action_action_menu +#: model_terms:ir.ui.view,arch_db:sh_global_search.sh_o2m_dynamic_action_form +msgid "Global Search Configuration" +msgstr "全局搜索配置" + +#. module: sh_global_search +#: model_terms:ir.ui.view,arch_db:sh_global_search.sh_m2o_global_search_form +msgid "Global Search M2O Action" +msgstr "全球搜索M2O行动" + +#. module: sh_global_search +#: model_terms:ir.ui.view,arch_db:sh_global_search.sh_o2m_global_search_form +msgid "Global Search O2M Action" +msgstr "全球搜索O2M行动" + +#. module: sh_global_search +#: model:ir.model,name:sh_global_search.model_global_search +msgid "Global search" +msgstr "全球搜寻" + +#. module: sh_global_search +#: model:ir.model,name:sh_global_search.model_global_search_fields +msgid "Global search fields" +msgstr "全局搜索字段" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search__id +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__id +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields__id +#: model:ir.model.fields,field_description:sh_global_search.field_res_company__id +#: model:ir.model.fields,field_description:sh_global_search.field_res_config_settings__id +msgid "ID" +msgstr "ID" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__name +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields__name +msgid "Label" +msgstr "标签" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search____last_update +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields____last_update +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields____last_update +#: model:ir.model.fields,field_description:sh_global_search.field_res_company____last_update +#: model:ir.model.fields,field_description:sh_global_search.field_res_config_settings____last_update +msgid "Last Modified on" +msgstr "最后修改时间" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search__write_uid +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__write_uid +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields__write_uid +msgid "Last Updated by" +msgstr "最后更新者" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search__write_date +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__write_date +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields__write_date +msgid "Last Updated on" +msgstr "最后更新时间:" + +#. module: sh_global_search +#: code:addons/sh_global_search/models/global_search.py:0 +#, python-format +msgid "M2O Object Fields" +msgstr "M2O对象字段" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__model_id +msgid "Model" +msgstr "模型" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search__main_field_id +msgid "Name Field" +msgstr "名称栏位" + +#. module: sh_global_search +#: code:addons/sh_global_search/models/global_search.py:0 +#, python-format +msgid "O2M Object Fields" +msgstr "O2M对象字段" + +#. module: sh_global_search +#: model:ir.model,name:sh_global_search.model_o2m_global_search_fields +msgid "O2m Global search fields" +msgstr "O2m全球搜索字段" + +#. module: sh_global_search +#: model_terms:ir.ui.view,arch_db:sh_global_search.sh_o2m_dynamic_action_form +msgid "Open Relation Fields" +msgstr "开放关系字段" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__field_id +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields__field_id +msgid "Position Field" +msgstr "位置栏位" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__global_search_id +msgid "Related Model" +msgstr "相关型号" + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__related_model_id +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields__model_id +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields__related_model_id +msgid "Relation With" +msgstr "与...的关系" + +#. module: sh_global_search +#. openerp-web +#: code:addons/sh_global_search/static/src/xml/apps.xml:0 +#, python-format +msgid "Search ..." +msgstr "搜索 ..." + +#. module: sh_global_search +#: model:ir.model.fields,field_description:sh_global_search.field_global_search_fields__sequence +#: model:ir.model.fields,field_description:sh_global_search.field_o2m_global_search_fields__sequence +msgid "Sequence" +msgstr "顺序" + +#. module: sh_global_search +#: model:res.groups,name:sh_global_search.group_global_search +msgid "Show Global Search Configuration" +msgstr "显示全局搜索配置" + +#. module: sh_global_search +#: model:ir.model.fields,help:sh_global_search.field_global_search__model_id +msgid "The model this field belongs to" +msgstr "此字段所属的模型" + +#. module: sh_global_search +#: model:res.groups,comment:sh_global_search.group_global_search +msgid "This user will be able to Show Global Search Configuration" +msgstr "该用户将能够显示全局搜索配置" diff --git a/sh_global_search/models/__init__.py b/sh_global_search/models/__init__.py new file mode 100644 index 00000000..f69c741c --- /dev/null +++ b/sh_global_search/models/__init__.py @@ -0,0 +1,3 @@ +# Copyright (C) Softhealer Technologies. + +from . import global_search diff --git a/sh_global_search/models/global_search.py b/sh_global_search/models/global_search.py new file mode 100644 index 00000000..39337b7f --- /dev/null +++ b/sh_global_search/models/global_search.py @@ -0,0 +1,462 @@ + # Copyright (C) Softhealer Technologies. + +from odoo import fields, models, api, _ +from odoo.exceptions import UserError +FIELD_TYPES = [(key, key) for key in sorted(fields.Field.by_type)] +from odoo import api, fields, models, _ +from odoo.osv import expression + +class ResCompany(models.Model): + _inherit = 'res.company' + + enable_menu_search = fields.Boolean( + "Enable Menu Global Search", default=True) + start_search_after_letter = fields.Integer( + "Search Start After Letter", default=0) + +class ResConfigSettings(models.TransientModel): + _inherit = 'res.config.settings' + + enable_menu_search = fields.Boolean( + related="company_id.enable_menu_search", string="Enable Menu Global Search", readonly=False) + start_search_after_letter = fields.Integer( + related="company_id.start_search_after_letter", string="Search Start After Letter", readonly=False) + +class GlobalSearch(models.Model): + _name = 'global.search' + _description = 'Global search' + _rec_name = 'model_id' + + model_id = fields.Many2one('ir.model', string='Applies To', required=True, index=True, ondelete='cascade', + help="The model this field belongs to") + + field_ids = fields.Many2many( + 'ir.model.fields', string='Fields', domain="[('model_id','=',model_id)]") + main_field_id = fields.Many2one('ir.model.fields', string="Name Field", + required=True, domain="[('model_id','=',model_id)]", ondelete='cascade') + global_field_ids = fields.One2many( + 'global.search.fields', 'global_search_id', string='Fields ') + + @api.model + def get_search_result(self, query): + search_result = {} + if self.env.user.company_id.enable_menu_search: + menu_roots = self.env['ir.ui.menu'].search( + [('parent_id', '=', False)]) + menu_data = self.env['ir.ui.menu'].search( + [('id', 'child_of', menu_roots.ids), ('action', '!=', False)]) + if menu_data: + menu_data = menu_data._filter_visible_menus() + for menu in menu_data: + if query[0].lower() in menu.complete_name.lower(): + search_result['menu| '+menu.complete_name] = { + 'id': menu.id, 'action': menu.action.id, 'name': menu.complete_name} + + # if company id field is not in model + for search_rec in self.env['global.search'].sudo().search([]): + + # All Field List including name field + normal_fields_list = [] + m2o_fields_list = [] + o2m_fields_list = [] + for fields in search_rec.global_field_ids: + field = fields.field_id + if field.ttype in ['char', 'boolean', 'text', 'date', 'datetime', 'float', 'integer', 'selection', 'monetary', 'html']: + normal_fields_list.append(field) + elif field.ttype in ['many2one']: + if search_rec.main_field_id not in m2o_fields_list: + m2o_fields_list.append(search_rec.main_field_id) + m2o_fields_list.append(field) + elif field.ttype in ['one2many']: + o2m_fields_list.append(field) + + # Fetch all record of this current model with defined field list + try: + # check company_id field in model + company_id_field = self.env['ir.model.fields'].sudo().search( + [('name', '=', 'company_id'), ('model_id', '=', search_rec.model_id.id)]) + + if not company_id_field: + if normal_fields_list: + normal_fields = [] + domain = [] + count = 0 + for field_row in normal_fields_list: + field = field_row.name + normal_fields.append(field) + if field != 'display_name': + domain.append((field, 'ilike', query[0])) + else: + count += 1 + if normal_fields: + model_obj = self.env[search_rec.model_id.model].search_read(domain, normal_fields, order='id') + for model_rec in model_obj: + for field_row in normal_fields_list: + field = field_row + if model_rec.get(field.name): + object_data = model_rec.get(field.name) + if object_data and query[0].lower() in str(object_data).casefold(): + model_rec['model'] = field.model_id.model + model_rec['model_name'] = field.model_id.name + search_result_record = model_rec.get( + search_rec.main_field_id.name) or '' + search_result[self.env.user.company_id.name+'|'+search_result_record+' > '+field.field_description+' : '+str( + object_data)] = model_rec + if count != 0: + field_list = ['display_name'] + model_obj = self.env[search_rec.model_id.model].search_read( + [], field_list, order='id') + for model_rec in model_obj: + if model_rec.get('display_name'): + object_data = model_rec.get('display_name') + if object_data and query[0].lower() in str(object_data).casefold(): + model_rec['model'] = search_rec.model_id.model + model_rec['model_name'] = search_rec.model_id.name + search_result[self.env.user.company_id.name+'|'+"Display Name"+' : '+str( + object_data)] = model_rec + if m2o_fields_list: + m2o_fields = [] + domain = [] + for field_row in m2o_fields_list: + field = field_row.name + m2o_fields.append(field) + domain.append(('%s.name' %(field), 'ilike', query[0])) + model_obj = self.env[search_rec.model_id.model].search_read(domain, m2o_fields, order='id') + for model_rec in model_obj: + for field_row in m2o_fields_list: + field = field_row + if field.name != 'display_name': + if model_rec.get(field.name): + object_data = model_rec.get(field.name) + if object_data and query[0].lower() in str(object_data).casefold(): + model_rec['model'] = field.model_id.model + model_rec['model_name'] = field.model_id.name + search_result_record = model_rec.get( + search_rec.main_field_id.name) or '' + str_object_data = str( + object_data[1]) + search_result[self.env.user.company_id.name+'|'+search_result_record+' > ' + + field.field_description+' : '+str_object_data] = model_rec + if o2m_fields_list: + for super_field_row in o2m_fields_list: + field = super_field_row.field_id.name + inside_normal_fields = [] + inside_m2o_field_list = [] + for o2m_field in super_field_row.field_ids: + field = o2m_field.field_id + if field.ttype in ['char', 'boolean', 'text', 'date', 'datetime', 'float', 'integer', 'selection', 'monetary', 'html']: + inside_normal_fields.append(field) + elif field.ttype in ['many2one']: + inside_m2o_field_list.append(field) + if search_rec.main_field_id not in inside_m2o_field_list: + inside_m2o_field_list.append(search_rec.main_field_id) + if search_rec.main_field_id not in inside_normal_fields: + inside_normal_fields.append(search_rec.main_field_id) + if inside_normal_fields: + normal_fields = [] + domain = [] + for field_row in inside_normal_fields: + field = field_row.name + normal_fields.append(field) + domain.append((field, 'ilike', query[0])) + model_obj = self.env[search_rec.model_id.model].search_read(domain, normal_fields, order='id') + for model_rec in model_obj: + for field_row in inside_normal_fields: + field = field_row + if model_rec.get(field.name): + object_data = model_rec.get(field.name) + if object_data and query[0].lower() in str(object_data).casefold(): + some_id = model_rec['id'] + some_record = self.env[super_field_row.model_id.model].browse(some_id) + search_result_record = model_rec.get( + search_rec.main_field_id.name) or '' + parent_obj = getattr(some_record, super_field_row.field_id.relation_field) + model_rec['model'] = parent_obj._name + model_rec['model_name'] = parent_obj._name.upper() + model_rec['id'] = parent_obj.id + str_object_data = str( + object_data) + search_result[self.env.user.company_id.name+'|'+parent_obj.name+' > ' + + field.field_description+' : '+str_object_data] = model_rec + if inside_m2o_field_list: + m2o_fields = [] + domain = [] + for field_row in inside_m2o_field_list: + field = field_row.name + m2o_fields.append(field) + domain.append(('%s.name' %(field), 'ilike', query[0])) + model_obj = self.env[search_rec.model_id.model].search_read(domain, m2o_fields, order='id') + for model_rec in model_obj: + for field_row in inside_m2o_field_list: + field = field_row + if field.name != 'display_name': + if model_rec.get(field.name): + object_data = model_rec.get(field.name) + if object_data and query[0].lower() in str(object_data).casefold(): + some_id = model_rec['id'] + some_record = self.env[super_field_row.model_id.model].browse(some_id) + search_result_record = model_rec.get( + search_rec.main_field_id.name) or '' + parent_obj = getattr(some_record, super_field_row.field_id.relation_field) + model_rec['model'] = parent_obj._name + model_rec['model_name'] = parent_obj._name.upper() + model_rec['id'] = parent_obj.id + str_object_data = str( + object_data[1]) + search_result[self.env.user.company_id.name+'|'+parent_obj.name+' > ' + + field.field_description+' : '+str_object_data] = model_rec + + except Exception as e: + print(e) + + # if company id field is in model + # All Global Search Records + count = 1 + for company in self.env['res.company'].search([]): + print("\n\n\n self.env.context.get('allowed_company_ids')",self.env.context) + # in self.env.context.get('allowed_company_ids') + if company.id: + for search_rec in self.env['global.search'].sudo().search([]): + # All Field List including name field + field_list = [] + for field in search_rec.global_field_ids: + field_list.append(field.field_id.name) + if search_rec.main_field_id.name not in field_list: + field_list.append(search_rec.main_field_id.name) + normal_fields_list = [] + m2o_fields_list = [] + o2m_fields_list = [] + external_addition = 0 + for fields in search_rec.global_field_ids: + field = fields.field_id + if field.ttype in ['char', 'boolean', 'text', 'date', 'datetime', 'float', 'integer', 'selection', 'monetary', 'html']: + normal_fields_list.append(field) + elif field.ttype in ['many2one']: + m2o_fields_list.append(field) + elif field.ttype in ['one2many']: + o2m_fields_list.append(fields) + if search_rec.main_field_id not in m2o_fields_list: + m2o_fields_list.append(search_rec.main_field_id) + if search_rec.main_field_id not in normal_fields_list: + external_addition += 1 + normal_fields_list.append(search_rec.main_field_id) + try: + # check company_id field in model + company_id_field = self.env['ir.model.fields'].sudo().search( + [('name', '=', 'company_id'), ('model_id', '=', search_rec.model_id.id)]) + + if company_id_field: + if normal_fields_list: + normal_fields = [field_row.name for field_row in normal_fields_list] + domain = [] + domain_multi_company = [('company_id', 'in', [company.id,False])] + field_domain = expression.OR([[(field_row.name, 'ilike', query[0])] for field_row in normal_fields_list if field_row.name != 'display_name']) + domain = expression.AND([domain_multi_company, field_domain]) + if normal_fields: + model_obj = self.env[search_rec.model_id.model].search_read(domain, normal_fields, order='id') + for model_rec in model_obj: + for field_row in normal_fields_list: + field = field_row + if field.name != 'display_name': + if model_rec.get(field.name): + object_data = model_rec.get(field.name) + if object_data and query[0].lower() in str(object_data).casefold(): + model_rec['model'] = field.model_id.model + model_rec['model_name'] = field.model_id.name + search_result_record = model_rec.get( + search_rec.main_field_id.name) or '' + search_result[company.name+'|'+search_result_record+' > '+field.field_description+' : '+str( + object_data)] = model_rec + if external_addition == 0: + field_list = ['display_name'] + model_obj = self.env[search_rec.model_id.model].search_read( + ['|', ('company_id', '=', company.id), ('company_id', '=', False)], field_list, order='id') + for model_rec in model_obj: + if model_rec.get('display_name'): + object_data = model_rec.get('display_name') + if object_data and query[0].lower() in str(object_data).casefold(): + model_rec['model'] = search_rec.model_id.model + model_rec['model_name'] = search_rec.model_id.name + search_result[company.name+'|'+"Display Name"+' : '+str( + object_data)] = model_rec + if m2o_fields_list: + m2o_fields = [field_row.name for field_row in m2o_fields_list] + domain = [] + domain_multi_company = [('company_id', 'in', [company.id,False])] + field_domain = expression.OR([[('%s.name' %(field_row.name), 'ilike', query[0])] for field_row in m2o_fields_list if field_row.name != 'display_name']) + domain = expression.AND([domain_multi_company, field_domain]) + model_obj = self.env[search_rec.model_id.model].search_read(domain, m2o_fields, order='id') + for model_rec in model_obj: + for field_row in m2o_fields_list: + field = field_row + if field.name != 'display_name': + if model_rec.get(field.name): + object_data = model_rec.get(field.name) + if object_data and query[0].lower() in str(object_data[1]).casefold(): + model_rec['model'] = field.model_id.model + model_rec['model_name'] = field.model_id.name + search_result_record = model_rec.get( + search_rec.main_field_id.name) or '' + str_object_data = str( + object_data[1]) + search_result[company.name+'|'+search_result_record+' > ' + + field.field_description+' : '+str_object_data] = model_rec + + if o2m_fields_list: + for super_field_row in o2m_fields_list: + field = super_field_row.field_id.name + inside_normal_fields = [] + inside_m2o_field_list = [] + for o2m_field in super_field_row.field_ids: + field = o2m_field.field_id + if field.ttype in ['char', 'boolean', 'text', 'date', 'datetime', 'float', 'integer', 'selection', 'monetary', 'html']: + inside_normal_fields.append(field) + elif field.ttype in ['many2one']: + if search_rec.main_field_id not in inside_m2o_field_list: + inside_m2o_field_list.append(search_rec.main_field_id) + inside_m2o_field_list.append(field) + if search_rec.main_field_id not in inside_normal_fields: + inside_normal_fields.append(search_rec.main_field_id) + if inside_normal_fields: + normal_fields = [field_row.name for field_row in inside_normal_fields] + domain = [] + domain_multi_company = [('company_id', 'in', [company.id,False])] + field_domain = expression.OR([[(field_row.name, 'ilike', query[0])] for field_row in inside_normal_fields if field_row.name != 'display_name']) + domain = expression.AND([domain_multi_company, field_domain]) + model_obj = self.env[super_field_row.related_model_id].search_read(domain, normal_fields, order='id') + for model_rec in model_obj: + for field_row in inside_normal_fields: + field = field_row + if model_rec.get(field.name): + object_data = model_rec.get(field.name) + if object_data and query[0].lower() in str(object_data).casefold(): + some_id = model_rec['id'] + some_record = self.env[super_field_row.model_id.model].browse(some_id) + search_result_record = model_rec.get( + search_rec.main_field_id.name) or '' + parent_obj = getattr(some_record, super_field_row.field_id.relation_field) + model_rec['model'] = parent_obj._name + model_rec['model_name'] = parent_obj._name.upper() + model_rec['id'] = parent_obj.id + str_object_data = str( + object_data) + search_result[company.name+'|'+parent_obj.name+' > ' + + field.field_description+' : '+str_object_data] = model_rec + if inside_m2o_field_list: + m2o_fields = [field_row.name for field_row in inside_m2o_field_list] + domain = [] + domain_multi_company = [('company_id', 'in', [company.id,False])] + if len(m2o_fields) > 1: + field_domain = expression.OR([[('%s.name' %(field_row.name), 'ilike', query[0])] for field_row in inside_m2o_field_list if field_row.name != 'display_name']) + else: + field_domain = ([('%s.name' %(field_row.name), 'ilike', query[0])] for field_row in m2o_fields) + domain = expression.AND([domain_multi_company, field_domain]) + model_obj = self.env[super_field_row.related_model_id].search_read(domain, m2o_fields, order='id') + for model_rec in model_obj: + for field_row in inside_m2o_field_list: + field = field_row + if field.name != 'display_name': + if model_rec.get(field.name): + object_data = model_rec.get(field.name) + if object_data and query[0].lower() in str(object_data[1]).casefold(): + some_id = model_rec['id'] + some_record = self.env[super_field_row.model_id.model].browse(some_id) + search_result_record = model_rec.get( + search_rec.main_field_id.name) or '' + parent_obj = getattr(some_record, super_field_row.field_id.relation_field) + model_rec['model'] = parent_obj._name + model_rec['model_name'] = parent_obj._name.upper() + model_rec['id'] = parent_obj.id + str_object_data = str( + object_data[1]) + search_result[company.name+'|'+parent_obj.name+' > ' + + field.field_description+' : '+str_object_data] = model_rec + except Exception as e: + print(e) + return search_result + + +class GlobalSearchFields(models.Model): + _name = 'global.search.fields' + _description = 'Global search fields' + + global_search_id = fields.Many2one('global.search', string='Related Model') + sequence = fields.Integer(string='Sequence', default=10) + field_id = fields.Many2one( + 'ir.model.fields', string='Position Field', ondelete='cascade') + name = fields.Char("Label", related="field_id.field_description") + model_id = fields.Many2one('ir.model', string='Model', ondelete='cascade') + related_model_id = fields.Char( + string='Relation With', related="field_id.relation") + ttype = fields.Selection( + string='Field Type', required=True, related="field_id.ttype") + field_ids = fields.One2many( + 'o2m.global.search.fields', 'global_o2m_search_id', string='Fields') + + @api.onchange('field_id') + def _onchange_field_id(self): + if self.field_id: + if self.field_id.relation: + model = self.env['ir.model'].sudo().search( + [('model', '=', self.field_id.relation)], limit=1) + if model: + self.model_id = model.id + + def sh_o2m_dynamic_action_action(self): + if self.ttype == 'one2many': + view = self.env.ref('sh_global_search.sh_o2m_global_search_form') + return { + 'name': _('O2M Object Fields'), + 'type': 'ir.actions.act_window', + 'view_mode': 'form', + 'res_model': 'global.search.fields', + 'views': [(view.id, 'form')], + 'view_id': view.id, + 'target': 'new', + 'res_id': self.id, + + } + else: + view = self.env.ref('sh_global_search.sh_m2o_global_search_form') + return { + 'name': _('M2O Object Fields'), + 'type': 'ir.actions.act_window', + 'view_mode': 'form', + 'res_model': 'global.search.fields', + 'views': [(view.id, 'form')], + 'view_id': view.id, + 'target': 'new', + 'res_id': self.id, + + } + + +class O2MGlobalSearch(models.Model): + _name = 'o2m.global.search.fields' + _description = 'O2m Global search fields' + + sequence = fields.Integer(string='Sequence', default=10) + name = fields.Char("Label") + field_id = fields.Many2one( + 'ir.model.fields', string='Position Field', ondelete='cascade') + global_o2m_search_id = fields.Many2one( + 'global.search.fields', string='Global O2M Search', ondelete='cascade') + model_id = fields.Many2one( + 'ir.model', string='Relation With ', ondelete='cascade') + related_model_id = fields.Char( + string='Relation With', related="field_id.relation") + ttype = fields.Selection( + string='Field Type', required=True, related="field_id.ttype") + + @api.onchange('field_id') + def _onchange_field_id(self): + if self.field_id: + if self.field_id.ttype in ['one2many', 'many2many']: + raise UserError( + "Field type One2many and Many2many not supported inside O2M wizard !") + self.name = self.field_id.field_description + if self.field_id.relation: + model = self.env['ir.model'].sudo().search( + [('model', '=', self.field_id.relation)], limit=1) + if model: + self.model_id = model.id diff --git a/sh_global_search/security/base_security.xml b/sh_global_search/security/base_security.xml new file mode 100644 index 00000000..94ca7290 --- /dev/null +++ b/sh_global_search/security/base_security.xml @@ -0,0 +1,7 @@ + + + Show Global Search Configuration + + This user will be able to Show Global Search Configuration + + diff --git a/sh_global_search/security/ir.model.access.csv b/sh_global_search/security/ir.model.access.csv new file mode 100644 index 00000000..5570308c --- /dev/null +++ b/sh_global_search/security/ir.model.access.csv @@ -0,0 +1,4 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_global_search,access_global_search,model_global_search,base.group_user,1,1,1,1 +access_global_search_fields,access_global_search_fields,model_global_search_fields,base.group_user,1,1,1,1 +access_o2m_global_search_fields,access_o2m_global_search_fields,model_o2m_global_search_fields,base.group_user,1,1,1,1 diff --git a/sh_global_search/static/description/1.png b/sh_global_search/static/description/1.png new file mode 100644 index 00000000..655efbf4 Binary files /dev/null and b/sh_global_search/static/description/1.png differ diff --git a/sh_global_search/static/description/10.png b/sh_global_search/static/description/10.png new file mode 100644 index 00000000..8041140b Binary files /dev/null and b/sh_global_search/static/description/10.png differ diff --git a/sh_global_search/static/description/2.png b/sh_global_search/static/description/2.png new file mode 100644 index 00000000..49d86d1c Binary files /dev/null and b/sh_global_search/static/description/2.png differ diff --git a/sh_global_search/static/description/3.png b/sh_global_search/static/description/3.png new file mode 100644 index 00000000..7a7395c1 Binary files /dev/null and b/sh_global_search/static/description/3.png differ diff --git a/sh_global_search/static/description/4.png b/sh_global_search/static/description/4.png new file mode 100644 index 00000000..b465c931 Binary files /dev/null and b/sh_global_search/static/description/4.png differ diff --git a/sh_global_search/static/description/5.png b/sh_global_search/static/description/5.png new file mode 100644 index 00000000..bafb1951 Binary files /dev/null and b/sh_global_search/static/description/5.png differ diff --git a/sh_global_search/static/description/6.png b/sh_global_search/static/description/6.png new file mode 100644 index 00000000..9c895a84 Binary files /dev/null and b/sh_global_search/static/description/6.png differ diff --git a/sh_global_search/static/description/7.png b/sh_global_search/static/description/7.png new file mode 100644 index 00000000..4d26b573 Binary files /dev/null and b/sh_global_search/static/description/7.png differ diff --git a/sh_global_search/static/description/8.png b/sh_global_search/static/description/8.png new file mode 100644 index 00000000..d82f5272 Binary files /dev/null and b/sh_global_search/static/description/8.png differ diff --git a/sh_global_search/static/description/9.png b/sh_global_search/static/description/9.png new file mode 100644 index 00000000..8e60b5cd Binary files /dev/null and b/sh_global_search/static/description/9.png differ diff --git a/sh_global_search/static/description/aarab.png b/sh_global_search/static/description/aarab.png new file mode 100644 index 00000000..143ffc97 Binary files /dev/null and b/sh_global_search/static/description/aarab.png differ diff --git a/sh_global_search/static/description/advance.png b/sh_global_search/static/description/advance.png new file mode 100644 index 00000000..baa8e70b Binary files /dev/null and b/sh_global_search/static/description/advance.png differ diff --git a/sh_global_search/static/description/background.png b/sh_global_search/static/description/background.png new file mode 100644 index 00000000..41f8ace0 Binary files /dev/null and b/sh_global_search/static/description/background.png differ diff --git a/sh_global_search/static/description/bom.png b/sh_global_search/static/description/bom.png new file mode 100644 index 00000000..f3521091 Binary files /dev/null and b/sh_global_search/static/description/bom.png differ diff --git a/sh_global_search/static/description/chinese.png b/sh_global_search/static/description/chinese.png new file mode 100644 index 00000000..fcab8452 Binary files /dev/null and b/sh_global_search/static/description/chinese.png differ diff --git a/sh_global_search/static/description/d1.png b/sh_global_search/static/description/d1.png new file mode 100644 index 00000000..b405fbf6 Binary files /dev/null and b/sh_global_search/static/description/d1.png differ diff --git a/sh_global_search/static/description/d2.png b/sh_global_search/static/description/d2.png new file mode 100644 index 00000000..f2d4965b Binary files /dev/null and b/sh_global_search/static/description/d2.png differ diff --git a/sh_global_search/static/description/d3.png b/sh_global_search/static/description/d3.png new file mode 100644 index 00000000..13d9aa96 Binary files /dev/null and b/sh_global_search/static/description/d3.png differ diff --git a/sh_global_search/static/description/d4.png b/sh_global_search/static/description/d4.png new file mode 100644 index 00000000..607ef77b Binary files /dev/null and b/sh_global_search/static/description/d4.png differ diff --git a/sh_global_search/static/description/d5.png b/sh_global_search/static/description/d5.png new file mode 100644 index 00000000..5967573e Binary files /dev/null and b/sh_global_search/static/description/d5.png differ diff --git a/sh_global_search/static/description/d6.png b/sh_global_search/static/description/d6.png new file mode 100644 index 00000000..f67264d6 Binary files /dev/null and b/sh_global_search/static/description/d6.png differ diff --git a/sh_global_search/static/description/email notification.png b/sh_global_search/static/description/email notification.png new file mode 100644 index 00000000..ef7b32a0 Binary files /dev/null and b/sh_global_search/static/description/email notification.png differ diff --git a/sh_global_search/static/description/eng.png b/sh_global_search/static/description/eng.png new file mode 100644 index 00000000..91ed5242 Binary files /dev/null and b/sh_global_search/static/description/eng.png differ diff --git a/sh_global_search/static/description/french.png b/sh_global_search/static/description/french.png new file mode 100644 index 00000000..15ac7512 Binary files /dev/null and b/sh_global_search/static/description/french.png differ diff --git a/sh_global_search/static/description/german.png b/sh_global_search/static/description/german.png new file mode 100644 index 00000000..13efbe59 Binary files /dev/null and b/sh_global_search/static/description/german.png differ diff --git a/sh_global_search/static/description/heading.png b/sh_global_search/static/description/heading.png new file mode 100644 index 00000000..34748218 Binary files /dev/null and b/sh_global_search/static/description/heading.png differ diff --git a/sh_global_search/static/description/icon.png b/sh_global_search/static/description/icon.png new file mode 100644 index 00000000..edc131a5 Binary files /dev/null and b/sh_global_search/static/description/icon.png differ diff --git a/sh_global_search/static/description/image1.png b/sh_global_search/static/description/image1.png new file mode 100644 index 00000000..b0a6b8e3 Binary files /dev/null and b/sh_global_search/static/description/image1.png differ diff --git a/sh_global_search/static/description/index.html b/sh_global_search/static/description/index.html new file mode 100644 index 00000000..d46b466c --- /dev/null +++ b/sh_global_search/static/description/index.html @@ -0,0 +1,1427 @@ + + + + + + + + + + + + + + + +
+
+
+
+
+ logo +
+
+ Community + Enterprise + Odoo.sh +
+
+
+
+
+ +
+
+
+

+ Global Search +

+ heading +

+ A global search used + to search any + object based on the + configuration. You + can search all + object's data + easily. You + can also configure + one to many fields. + The "Global Search" + is visible to all + odoo users. The + search box is + available + at the top of the + menu. Search results + on click redirect to + that record on the + new tab. You can + easily perform a + search + on multi-company + objects also we have + beautifully show + company name before + so + you can see search + results related to + that company, we + have show object + (model) nicely + whenever you have + search + query found in + multiple objects, + you can + very easily see the + difference of + different objects. + It also takes care + of + access rights of + users, if a user + doesn't have any + object access than + it + will not show that + record in search + results. if the user + has multi-company + enabled than it + shows multi-company + results. We have + made this looks + fully + configurable you can + easily configure + what is an important + object(model) and + related fields of + that object(model), + We + have made security + groups for this + configurations so + only who have right + that user only can + configure this + global + search objects and + fields, All internal + users can use this + global search + feature. Cheers! +

+
+
+
+
+
+ +
+
+
+
+
+ + + +
+ + +
+
+ + +
+
+
+

+ Hot Features

+ heading +
+
+
+
+ + + Search All Objects Data + +
+
+
+
+ + Search By Message Or Content + +
+
+ + +
+
+ + Search Using Different Attributes + +
+
+
+
+ +
+ +
+
+
+

+ Features

+ heading +
+
+
    +
  • + + You can search + by any message, + subject, + or content. +
  • +
  • + + It will redirect + to search menus. +
  • + +
  • + + Beautifully + present search + results. +
  • +
  • + + Easy to + differentiate + the results of + different + objects and + different + companies. +
  • +
  • + + Easy to search + any object in + odoo. +
  • +
  • + + You can search + all object's + data in a + single click. +
  • +
  • + + Search results + on click + redirect to that + record on the + new tab. +
  • +
  • + + You can also + search for + multi-company if + the user has + multi-company + enabled. +
  • +
  • + + The "Global + Search" is + visible to all + odoo internal + users. +
  • +
  • + + You can + configure one to + many fields in + object. +
  • +
  • + + You don't need + to go to + individual + objects. + +
  • +
  • + + You can search + using different + attributes like + name, reference + no, etc. + +
  • +
  • + + No special + configuration + required, + install it, use + it. +
  • +
  • + + This module + saves your + important time. +
  • +
  • + + It reduces human + efforts. +
  • +
+
+
+
+
+
+ +
+ + +
+
+
+
+

+ Enable + the + "Show + Global + Search + Configuration" + menu. +

+
+ +
+
+ +
+

+ We + can + configure + object + for + global + search + from + here. +

+
+ +
+
+

+ Select + object/model, + name + field, + model + fields. + For + one + to + many + fields, + you + can + configure + from + the + smart + button. +

+
+ +
+
+

+ After + that + one + wizard + open, + add + one + to + many + fields. +

+
+ +
+
+

+ You + can + search + the + object + based + on + configuration. + "Global + Search" + visible + to + the + whole + odoo + user. +

+
+ +
+
+

+ Object + wise + search + result + looks + like + below. +

+
+ +
+
+ +

+ On + the + click + search + result, + it + will + redirect + to + that + record. +

+
+ +
+
+

+ Related + record + on + click + search + result + redirects + on + the + new + tab. +

+
+ +
+
+

+ If + multi-company + activates + in + users + look + like + this. +

+
+ +
+
+

+ The + multi-company + result + looks + like + below. +

+
+ +
+
+

+ We + can + search + by + message, + subject, + or + any + content. +

+
+ +
+
+

+ The + searched + result + looks + like + this. +

+
+ +
+
+

+ Tick + the + "Enable + Menu + Global + Search" + for + search + menus + and + redirect + there. +

+
+ +
+
+

+ The + searched + result. +

+
+ +
+
+

+ Enter letter number to search after that letter in search box. +

+
+ +
+
+

+ The + searched + result. +

+
+ +
+
+

+ You can clear the search value using the cancel button and when clicked in the body + it clears the search value. +

+
+ +
+
+
+
+
+
+ + +
+
+

+ + Version + 16.0.1 + | + Released + on : 18th + November + 2022 +

+
+
+ + Initial + + Initial + Release. +
+
+
+ +
+ + +
+
+
+ +
+ +
+
+
    +
  • + Yes, + this + app + works + perfectly + with + Odoo + Enterprise + (Odoo.sh + & + Premise) + as + well + as + Community. +
  • +
+
+
+
+ +
+ +
+
+
    +
  • + No!, This app is not compatible with odoo SASS. +
  • +
+
+
+
+ +
+ +
+
+ +
+
+
+
+ +
+
+
    +
  • + Yes, + we + provide + free + support + for + 100 + days. +
  • +
+
+
+
+ + +
+ +
+
+
    +
  • + Yes, + you + will + get + free + update + for + lifetime. +
  • +
+
+
+
+ +
+ +
+
+
    +
  • + No, + you + don't + need + to + install + addition + libraries. +
  • +
+
+
+
+ +
+ +
+
+
    +
  • + Yes, + You + have + to + download + module + for + each + version + (13,14,15) + except + in + version + 12 + or + lower. +
  • +
+
+
+
+ +
+ +
+
+
    +
  • + No, + We + do + not + provide + any + kind + of + exchange. +
  • +
+
+
+
+
+
+
+ + + + +
+
+
+
+
+
+
+

+ Multi-Languages +

+ heading +
+
+ + We have added + predefined + some + languages(English, + German / Deutsch, + Arabic, + Spanish / Espanol, + French + / Francais, Chinese) + in + module, If you want + to + add other language + you + can contact us on support@softhealer.com. + We use google + translator + tools for + multi-languages + so possible + translations + can be not accurate. + we + accept suggest to + make + more accurate + translations also on + support@softhealer.com. +

+
+
+
+
+
+ english + germany + arab + spanish + Chinese + French +
+
+
+
+
+
+
+ +
+
+
+ + +
+
+
+
+
+ +
+
+
+

+ You May Also Like +

+ heading +
+
+
+
+
+ + Emate - Email theme + +
+
+
+
+
+
+ + Signup Email Verification + +
+
+
+
+
+
+ + New Sale Order Email Notification + +
+
+
+
+
+
+ + Overdue Task Email Notification + +
+
+
+
+
+
+ + POS Order E-mail Notification + +
+
+
+
+
+
+ + Activity Notification + +
+
+
+
+
+
+
+
+
+

Most Demanded Apps

+ heading +
+
+
+
+
+ + sh_all_in_one_mbs + +
+
+
+
+
+
+ + sh_activities_management + +
+
+
+
+
+
+ + sh_all_in_one_helpdesk + +
+
+
+
+
+
+ + sh_secondary_unit + +
+
+
+
+
+
+ + sh_barcode_scanner + +
+
+
+ +
+
+
+ + sh_global_custom_fields + +
+
+
+
+
+
+
+
+
+

+ Our Services

+ heading +
+ +
+
+
+
+ +
+
+
+
+ Skype +
+
+ Email +
+
+
+
+
+
+ + + \ No newline at end of file diff --git a/sh_global_search/static/description/info.png b/sh_global_search/static/description/info.png new file mode 100644 index 00000000..2317ee9e Binary files /dev/null and b/sh_global_search/static/description/info.png differ diff --git a/sh_global_search/static/description/mobileapp.png b/sh_global_search/static/description/mobileapp.png new file mode 100644 index 00000000..cf31da45 Binary files /dev/null and b/sh_global_search/static/description/mobileapp.png differ diff --git a/sh_global_search/static/description/motor.png b/sh_global_search/static/description/motor.png new file mode 100644 index 00000000..cacac719 Binary files /dev/null and b/sh_global_search/static/description/motor.png differ diff --git a/sh_global_search/static/description/n1.png b/sh_global_search/static/description/n1.png new file mode 100644 index 00000000..76d0cd48 Binary files /dev/null and b/sh_global_search/static/description/n1.png differ diff --git a/sh_global_search/static/description/n2.png b/sh_global_search/static/description/n2.png new file mode 100644 index 00000000..5f942f67 Binary files /dev/null and b/sh_global_search/static/description/n2.png differ diff --git a/sh_global_search/static/description/n3.png b/sh_global_search/static/description/n3.png new file mode 100644 index 00000000..a998a070 Binary files /dev/null and b/sh_global_search/static/description/n3.png differ diff --git a/sh_global_search/static/description/n4.png b/sh_global_search/static/description/n4.png new file mode 100644 index 00000000..d8c4812a Binary files /dev/null and b/sh_global_search/static/description/n4.png differ diff --git a/sh_global_search/static/description/new email notify.png b/sh_global_search/static/description/new email notify.png new file mode 100644 index 00000000..e66d6b10 Binary files /dev/null and b/sh_global_search/static/description/new email notify.png differ diff --git a/sh_global_search/static/description/overdue.png b/sh_global_search/static/description/overdue.png new file mode 100644 index 00000000..79ea2faf Binary files /dev/null and b/sh_global_search/static/description/overdue.png differ diff --git a/sh_global_search/static/description/pos order email.jpg b/sh_global_search/static/description/pos order email.jpg new file mode 100644 index 00000000..c86a58ec Binary files /dev/null and b/sh_global_search/static/description/pos order email.jpg differ diff --git a/sh_global_search/static/description/purchase.png b/sh_global_search/static/description/purchase.png new file mode 100644 index 00000000..9cacaa3c Binary files /dev/null and b/sh_global_search/static/description/purchase.png differ diff --git a/sh_global_search/static/description/s1.png b/sh_global_search/static/description/s1.png new file mode 100644 index 00000000..e3cad9ad Binary files /dev/null and b/sh_global_search/static/description/s1.png differ diff --git a/sh_global_search/static/description/s2.png b/sh_global_search/static/description/s2.png new file mode 100644 index 00000000..ec7243d2 Binary files /dev/null and b/sh_global_search/static/description/s2.png differ diff --git a/sh_global_search/static/description/sale.png b/sh_global_search/static/description/sale.png new file mode 100644 index 00000000..fe86a71b Binary files /dev/null and b/sh_global_search/static/description/sale.png differ diff --git a/sh_global_search/static/description/setting.png b/sh_global_search/static/description/setting.png new file mode 100644 index 00000000..a7c85087 Binary files /dev/null and b/sh_global_search/static/description/setting.png differ diff --git a/sh_global_search/static/description/sh_helpdesk.png b/sh_global_search/static/description/sh_helpdesk.png new file mode 100644 index 00000000..8b874b00 Binary files /dev/null and b/sh_global_search/static/description/sh_helpdesk.png differ diff --git a/sh_global_search/static/description/softhealer.png b/sh_global_search/static/description/softhealer.png new file mode 100644 index 00000000..2d311c35 Binary files /dev/null and b/sh_global_search/static/description/softhealer.png differ diff --git a/sh_global_search/static/description/spanish.jpg b/sh_global_search/static/description/spanish.jpg new file mode 100644 index 00000000..4a6df1f9 Binary files /dev/null and b/sh_global_search/static/description/spanish.jpg differ diff --git a/sh_global_search/static/description/ssss.png b/sh_global_search/static/description/ssss.png new file mode 100644 index 00000000..10fbdc0c Binary files /dev/null and b/sh_global_search/static/description/ssss.png differ diff --git a/sh_global_search/static/description/stock.png b/sh_global_search/static/description/stock.png new file mode 100644 index 00000000..5e93b1a4 Binary files /dev/null and b/sh_global_search/static/description/stock.png differ diff --git a/sh_global_search/static/description/user.png b/sh_global_search/static/description/user.png new file mode 100644 index 00000000..3717e4f2 Binary files /dev/null and b/sh_global_search/static/description/user.png differ diff --git a/sh_global_search/static/description/vd_btn.png b/sh_global_search/static/description/vd_btn.png new file mode 100644 index 00000000..68a5c4c6 Binary files /dev/null and b/sh_global_search/static/description/vd_btn.png differ diff --git a/sh_global_search/static/src/img/barcode.png b/sh_global_search/static/src/img/barcode.png new file mode 100644 index 00000000..ce0dc871 Binary files /dev/null and b/sh_global_search/static/src/img/barcode.png differ diff --git a/sh_global_search/static/src/js/GlobalSearch.js b/sh_global_search/static/src/js/GlobalSearch.js new file mode 100644 index 00000000..4581a2db --- /dev/null +++ b/sh_global_search/static/src/js/GlobalSearch.js @@ -0,0 +1,193 @@ +/** @odoo-module **/ + +import { Dropdown } from "@web/core/dropdown/dropdown"; +import { DropdownItem } from "@web/core/dropdown/dropdown_item"; +import { useService } from "@web/core/utils/hooks"; +import { registry } from "@web/core/registry"; +import { browser } from "@web/core/browser/browser"; +import { symmetricalDifference } from "@web/core/utils/arrays"; +import { _t, qweb as QWeb } from "web.core"; +import * as BarcodeScanner from "@web/webclient/barcode/barcode_scanner"; + +const { Component, useState } = owl; +const session = require("web.session"); +const rpc = require("web.rpc"); +var show_company = false; +session.user_has_group("base.group_multi_company").then(function (has_group) { + show_company = has_group; +}); +var start_search_after_letter = 0 + + + +export class GlobalSearch extends Component { + setup() { + var self = this; + self.actionService = useService("action") + this._search_def = $.Deferred(); + this.show_company = show_company; + this.allowed_company_ids = String(session.user_context.allowed_company_ids) + .split(",") + .map(function (id) { + return parseInt(id); + }); + this.current_company = this.allowed_company_ids[0]; + rpc.query({ + model: "res.company", + method: "search_read", + args: [[["id", "=", self.current_company]], ["start_search_after_letter"]], + }).then(function (data) { + if(data){ + if(data && data[0]){ + start_search_after_letter = data[0].start_search_after_letter; + } + + } + + }); + + + } + async on2BarcodeBtnClick() { + const barcode = await BarcodeScanner.scanBarcode(); + console.log(barcode); + if (barcode) { + console.log("存在"); + const input = document.querySelector('.usermenu_search_input'); + if (input) { + input.value = barcode; + } + const event = new KeyboardEvent('keydown', {key: 'Enter'}); + input.dispatchEvent(event); + + // await this.onBarcodeScanned(barcode); + // if ("vibrate" in browser.navigator) { + // browser.navigator.vibrate(100); + // } + } else { + // console.log("不存在") + // alert('不存在') + this.notification.add(this.env._t("Please, scan again !"), { + type: "warning", + }); + } + } + + onSearchResultsNavigate(){ + this._search_def.reject(); + this._search_def = $.Deferred(); + setTimeout(this._search_def.resolve.bind(this._search_def), 500); + + this._search_def.done(this._searchData.bind(this)); + + return; + } + _on_click_clear_Search(){ + $(".sh_search_input input").val(''); + $(".sh_search_results").empty(); + } + + _searchData() { + + var query = $(".sh_search_input input").val(); + if (query === "") { + $(".sh_search_container").removeClass("has-results"); + $(".sh_search_results").empty(); + return; + } + $(".sh_search_results").empty(); + var self = this; + if (query.length >=start_search_after_letter) { + rpc.query({ + model: "global.search", + method: "get_search_result", + args: [[query]], + }).then(function (data) { + if (data) { + $(".sh_search_results").show(); + console.log('data',data) + self._searchableMenus = data; + + // var results = fuzzy.filter(query, _.keys(self._searchableMenus), {}); + + var results = _.keys(self._searchableMenus); + console.log('results',results) + if (results.length === 1) { + // 不显示搜索结果,直接跳转 + $(".sh_search_results").hide(); + var result = results[0]; + console.log('result',result) + var original = self._searchableMenus[result]; + console.log('original',original) + // if (original.action) { + // self.do_action(original.action); + // } else if (original.menu_id) { + // self.do_action(original.menu_id); + // } + if (original) { + self.actionService.doAction({ + type: "ir.actions.act_window", + res_model: original.model, + res_id: original.id, + views: [[false, "form"]], + target: "current", + flags: { action_buttons: true, headless: true }, + + }); + } + + } + $(".sh_search_results").toggleClass("has-results", Boolean(results.length)); + + $(QWeb.render('MenuSearchResults', { + results: results, + widget:self, + _checkIsMenu: (key) => { + console.log('123',key) + key = key.split("|")[0]; + if (key == "menu") { + return true; + } else { + return false; + } + }, + _linkInfo: (key) => { + var original = self._searchableMenus[key]; + return original; + }, + _getFieldInfo: (key) => { + key = key.split("|")[1]; + return key; + }, + _getcompanyInfo: (key) => { + key = key.split("|")[0]; + return key; + }, + _linkInfo: (key) => { + var original = self._searchableMenus[key]; + return original; + } + + + })).appendTo($(".sh_search_results")); + + + + } + }); + } + } + +} +GlobalSearch.template = "GlobalSearch"; +GlobalSearch.components = { Dropdown, DropdownItem }; +GlobalSearch.toggleDelay = 1000; + +export const systrayItem = { + Component: GlobalSearch, +}; + +registry.category("systray").add("GlobalSearch", systrayItem, { sequence: 1 }); + + + diff --git a/sh_global_search/static/src/scss/GlobalSearch.scss b/sh_global_search/static/src/scss/GlobalSearch.scss new file mode 100644 index 00000000..7d69d9cf --- /dev/null +++ b/sh_global_search/static/src/scss/GlobalSearch.scss @@ -0,0 +1,89 @@ +.sh_search_results { + position: fixed !important; + overflow-x: hidden; + overflow-y: auto; + box-shadow: none; + border: none; + width: 40vw; + z-index: 111; + top: 45px;left: auto;right: 0; + background: #71639e; + max-height: calc(100% - #{$o-navbar-height}); +} +.sh_search_results .dropdown-item:hover { + color: #333232; +} +.sh_search_results .dropdown-item:active { + color: #333232; +} +.sh_search_container .sh_search_input .clear_Search:focus{outline: none;} + +.sh_search_results .dropdown-item { + color: #fff; + white-space: normal; + word-break: break-word; +} +.sh_search_input { + margin-top: 5px; +} + +.sh_search_container { + padding-left: 15px; + padding-right: 15px; +} + +.sh_search_input .usermenu_search_input { + background: transparent; + border: none; + border-bottom: 1px solid white; + box-shadow: none; + color: #fff; + border-radius: unset; +} +.sh_search_input .usermenu_search_input::placeholder { + color: #fff; +} + +.input-group-text{ + background: transparent; + border: none; + border-bottom: 0px solid white; + color: #fff; + border-radius: 0px; +} +.search_company_detail { + border-bottom: 1px solid white; + margin-bottom: 2px; + margin-top: 5px; + color:#fff; +} + +.clear_Search { + background: transparent; + border: none; + color: #fff; + border-bottom: 0px solid white; + border-radius: 0px; +} + +.barcode-button { + border: none; + background-color: transparent; +} + +.barcode-icon { + color: white; + //z-index: 10; + //position: relative; + //top: -10px; +} + +.icon-button { + border: none; + color: white; + background-color: transparent; + padding: 0; + +} + +.sh_search_container .sh_search_input .input-group-prepend{background: transparent;border: none;border-bottom: 1px solid white;padding-top: 5px;} \ No newline at end of file diff --git a/sh_global_search/static/src/xml/GlobalSearch.xml b/sh_global_search/static/src/xml/GlobalSearch.xml new file mode 100644 index 00000000..d86413ce --- /dev/null +++ b/sh_global_search/static/src/xml/GlobalSearch.xml @@ -0,0 +1,72 @@ + + + + +
+
+
+
+ + + +
+ + + +
+ +
+ +
+
+
+
+
+
+ + + + + + + + + + + + + + + +

+ + : + +

+
+ + + + + + +

:

+
+ + +
+ + +

+ + : + +

+ +
+
+
+
+
+ diff --git a/sh_global_search/views/global_search_view.xml b/sh_global_search/views/global_search_view.xml new file mode 100644 index 00000000..2c5cc29a --- /dev/null +++ b/sh_global_search/views/global_search_view.xml @@ -0,0 +1,148 @@ + + + + + enable.menu.search + res.config.settings + + + +

Enable Global Menu Search

+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+ + + sh.dynamic.action.fields.form + global.search.fields + +
+ + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + sh.global.search.fields.form + global.search.fields + +
+ + + + + + + + + + + + + + + + + + + +
+
+
+ + sh.dynamic.action.fields.form + global.search + +
+ + + + + + + + + + + + + + + + + +