You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

394 lines
22 KiB

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<!-- form view -->
<record model="ir.ui.view" id="master_search_form">
<field name="name">Search</field>
<field name="model">master.search</field>
<field name="arch" type="xml">
<form string="Search">
<style>
.o_control_panel{display: none;}
</style>
<script>
$(document).ready(function(){
$(".disable_open").unbind("click");
if ($(".oe_search_bgnd").length > 0){document.title =
'Search';}
function toggleDetailsTree($target) {
var element =
$target.closest('.oe_result_div').find('.oe_details_tree');
element.toggleClass('oe_details_tree--show');
}
$(document).on("click", ".expand_tile", function(event)
{
var $target = $(event.target);
if ($target.hasClass('expand_tile')) {
toggleDetailsTree($target);
} else if ($target.hasClass('history')) {
toggleDetailsTree($target);
} else if ($target.hasClass('dropdown')) {
toggleDetailsTree($target);
}
});
$('.o_radio_input').on('change', function(){
let targetEl = $(this).data().value;
$('.oe_details_tree').addClass('d-none');
$('.oe_details_tree').removeClass('oe_details_tree--show');
switch(targetEl){
case 'customer':
$('.oe_search_tab').addClass('d-none');
$('#customer_search_results').addClass('d-block');
$('#customer_search_results').removeClass('d-none');
break;
case 'product':
$('.oe_search_tab').addClass('d-none');
$('#product_search_results').addClass('d-block');
$('#product_search_results').removeClass('d-none');
break;
case 'transaction details':
$('.oe_search_tab').addClass('d-none');
$('#inventory_search_results').addClass('d-block');
$('#inventory_search_results').removeClass('d-none');
break;
case 'sale details':
$('.oe_search_tab').addClass('d-none');
$('#sale_search_results').addClass('d-block');
$('#sale_search_results').removeClass('d-none');
break;
case 'purchase details':
$('.oe_search_tab').addClass('d-none');
$('#purchase_search_results').addClass('d-block');
$('#purchase_search_results').removeClass('d-none');
break;
case 'account details':
$('.oe_search_tab').addClass('d-none');
$('#accounting_search_results').addClass('d-block');
$('#accounting_search_results').removeClass('d-none');
break;
case 'any':
$('.oe_search_tab').removeClass('d-none');
break;
}
$('#recent_searches').addClass('d-block');
$('#recent_searches').removeClass('d-none');
})
});
</script>
<sheet>
<div class="row oe_search_bgnd"
style="padding: 24px 32px;background-color:#e5e4f9;border-radius: 5px;">
<div class="col-12 col-md-8 col-xl-8">
<label for="search_string" string="Search "
style="display: inline-block;"
class="oe_read_only"/>
<field name="search_string" default_focus="1"
class="search_input"
style="width: 80%; display: inline-block;margin-right: 0px;block-size: 32px;"
placeholder="Type here to search.."/>
<button name="action_clear_search"
type="object" title="Search"
class="fa fa-times oe_edit_only btn_master_search"/>
<button name="action_search"
type="object"
title="Search"
class="fa fa-search oe_search_btn btn_master_search oe_edit_only"/>
<div class="not-allowed">Regular expressions are
not allowed in search!
</div>
<div>
<label for="match_entire"
string="Match Phrase :"
style="display: inline-block;"/>
<field name="match_entire"
style="display: inline-block; margin-left: 10px;"/>
</div>
<div style="display: block;">
<label for="search_by" string="Search For :"
class="oe_read_only"/>
<field name="search_by" widget="radio"
options="{'horizontal': true}"/>
</div>
</div>
<div class="col-12 col-md-4 col-xl-4">
<div style="display: block;">
<label for="search_mode" string="Mode :"
class="oe_read_only"/>
<field name="search_mode" widget="radio"
nolabel="1"
options="{'horizontal': false}"/>
</div>
</div>
</div>
<div class="oe_result_div">
<div id="recent_searches" style="background-color: #5f5e97; color: #fff; width: 100%; padding: 5px 10px;
margin-top: 10px; border-top-right-radius: 5px;border-top-left-radius: 5px;"
class="oe_search_tab expand_tile">
Recent Searches
<div class="history" style="float: right;">
<field name="history_count"
class="oe_tab_count" readonly="1"/>
Records Found
<span class="oe_drop_down">
<i style="color: #fff !important; font-size: 16px;"
title="Search"
class="fa fa-caret-down dropdown"
/>
</span>
</div>
</div>
<div style="height: 200px; overflow-y: scroll;width: 100%;"
class="oe_details_tree">
<field name="master_search_ids">
<tree create="0" class="disable_open">
<field name="search_string"
class="re_search oe_key"/>
<field name="search_mode" string="Mode"
class="re_search"/>
<field name="search_by" string="Type"
class="re_search"/>
<!--<field name="create_date" string="Date" optional="hide" class="re_search"/>-->
<button style="display: inline-block;"
name="action_unlink_search"
title="Search" type="object"
class="fa fa-trash"/>
</tree>
</field>
</div>
</div>
<div class="oe_result_div">
<div id="customer_search_results"
style="background-color: #5f5e97; color: #fff; width: 100%; padding: 5px 10px;
margin-top: 10px; border-top-right-radius: 5px;border-top-left-radius: 5px;"
class="oe_search_tab accordion_tab expand_tile">
Customer Search Results
<div class="history" style="float: right;">
<field name="customer_count"
class="oe_tab_count" readonly="1"/>
Records Found
<span class="oe_drop_down">
<i style="color: #fff !important; font-size: 16px;"
title="Search"
class="fa fa-caret-down dropdown"
/>
</span>
</div>
</div>
<div style="height: 200px; overflow-y: scroll;width: 100%;"
class="oe_details_tree">
<field name="customer_ids">
<tree create="0" delete="0">
<field name="name" string="Name"/>
<field name="email" string="Email"/>
</tree>
</field>
</div>
</div>
<div class="oe_result_div">
<div id="product_search_results" style="background-color: #5f5e97; color: #fff; width: 100%; padding: 5px 10px;
margin-top: 10px; border-top-right-radius: 5px;border-top-left-radius: 5px;"
class="oe_search_tab accordion_tab expand_tile">
Product Search Results
<div class="history" style="float: right;">
<field name="product_count"
class="oe_tab_count" readonly="1"/>
Records Found
<span class="oe_drop_down">
<i style="color: #fff !important; font-size: 16px;"
title="Search"
class="fa fa-caret-down dropdown"/>
</span>
</div>
</div>
<div style="height: 200px; overflow-y: scroll;width: 100%;"
class="oe_details_tree"
name="products">
<field name="product_ids">
<tree create="0" delete="0">
<field name="name" string="Name"/>
<field name="default_code"
string="Code"/>
<field name="description"
string="Description"/>
<field name="type"
string="Product Type"/>
<field name="categ_id"
string="Category"/>
<field name="uom_id" string="Base UoM"
optional="hide"/>
<field name="qty_available"
string="Stock"/>
</tree>
</field>
</div>
</div>
<div class="oe_result_div">
<div id="inventory_search_results" style="background-color: #5f5e97; color: #fff; width: 100%; padding: 5px 10px;
margin-top: 10px; border-top-right-radius: 5px;border-top-left-radius: 5px;"
class="oe_search_tab accordion_tab expand_tile">
Inventory Search Results
<div class="history" style="float: right;">
<field name="transaction_count"
class="oe_tab_count" readonly="1"/>
Records Found
<span class="oe_drop_down">
<i style="color: #fff !important; font-size: 16px;"
title="Search"
class="fa fa-caret-down dropdown"/>
</span>
</div>
</div>
<div style="height: 200px; overflow-y: scroll;width: 100%;"
class="oe_details_tree">
<field name="transaction_details">
<tree create="0" delete="0">
<field name="name" string="Trans. # "/>
<field name="date_done"
string="Transaction Date"/>
<field name="picking_type_id"
string="Transaction Type"/>
<field name="partner_id"
string="Reference Name"/>
<field name="state"
string="Transaction Status"/>
</tree>
</field>
</div>
</div>
<div class="oe_result_div">
<div id="sale_search_results" style="background-color: #5f5e97; color: #fff; width: 100%; padding: 5px 10px;
margin-top: 10px; border-top-right-radius: 5px;border-top-left-radius: 5px;"
class="oe_search_tab accordion_tab expand_tile">
Sale Search Results
<div class="history" style="float: right;">
<field name="sale_count"
class="oe_tab_count" readonly="1"/>
Records Found
<span class="oe_drop_down">
<i style="color: #fff !important; font-size: 16px;"
title="Search"
class="fa fa-caret-down dropdown"/>
</span>
</div>
</div>
<div style="height: 200px; overflow-y: scroll;width: 100%;"
class="oe_details_tree">
<field name="sale_details">
<tree create="0" delete="0">
<field name="name" string="Trans. # "/>
<field name="partner_id"
string="Customer"/>
<field name="pricelist_id"
string="Pricelist"/>
<field name="payment_term_id"
string="Payment Term"/>
<field name="state" string="Status"/>
</tree>
</field>
</div>
</div>
<div class="oe_result_div">
<div id="purchase_search_results" style="background-color: #5f5e97; color: #fff; width: 100%; padding: 5px 10px;
margin-top: 10px; border-top-right-radius: 5px;border-top-left-radius: 5px;"
class="oe_search_tab accordion_tab expand_tile">
Purchase Search Results
<div class="history" style="float: right;">
<field name="purchase_count"
class="oe_tab_count" readonly="1"/>
Records Found
<span class="oe_drop_down">
<i style="color: #fff !important; font-size: 16px;"
title="Search"
class="fa fa-caret-down dropdown"/>
</span>
</div>
</div>
<div style="height: 200px; overflow-y: scroll;width: 100%;"
class="oe_details_tree">
<field name="purchase_details">
<tree create="0" delete="0">
<field name="name" string="Trans. # "/>
<field name="partner_id"
string="Customer"/>
<field name="state" string="Status"/>
</tree>
</field>
</div>
</div>
<div class="oe_result_div">
<div id="accounting_search_results" style="background-color: #5f5e97; color: #fff; width: 100%; padding: 5px 10px;
margin-top: 10px; border-top-right-radius: 5px;border-top-left-radius: 5px;"
class="oe_search_tab accordion_tab expand_tile">
Accounting Search Results
<div class="history" style="float: right;">
<field name="account_count"
class="oe_tab_count" readonly="1"/>
Records Found
<span class="oe_drop_down">
<i style="color: #fff !important; font-size: 16px;"
title="Search"
class="fa fa-caret-down dropdown"/>
</span>
</div>
</div>
<div style="height: 200px; overflow-y: scroll;width: 100%;"
class="oe_details_tree">
<field name="account_details">
<tree create="false" delete="false"
edit="false">
<field name="name" string="Trans. # "/>
<field name="partner_id"
string="Customer"/>
<field name="state" string="Status"/>
</tree>
</field>
</div>
</div>
</sheet>
</form>
</field>
</record>
<!-- actions opening views on models -->
<record model="ir.actions.act_window" id="master_search_action">
<field name="name">Search</field>
<field name="res_model">master.search</field>
<field name="view_mode">form</field>
<field name="context">{'active_test': False,
'search_default_filter_active': 1}
</field>
</record>
<!-- Search root menu -->
<menuitem id="master_search_root" name="Search"
action="master_search_action"
web_icon="master_search,static/description/icon.png"
sequence="2" groups="master_search.master_search_read"/>
</data>
</odoo>