diff --git a/pos_hide_partnerlist/__init__.py b/pos_hide_partnerlist/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/pos_hide_partnerlist/__manifest__.py b/pos_hide_partnerlist/__manifest__.py new file mode 100644 index 0000000..563d576 --- /dev/null +++ b/pos_hide_partnerlist/__manifest__.py @@ -0,0 +1,17 @@ +{ + "name": "POS Hide Customer List Until Search", + "version": "16.0.1.0.0", + "summary": "Hide the customer list until the search bar is used", + "category": "Point of Sale", + "author": "Criptomart", + "website": "", + "depends": ["point_of_sale"], + "assets": { + "point_of_sale.assets": [ + "pos_hide_partnerlist/static/src/js/HideCustomerList.js", + ], + }, + "installable": True, + "application": False, + "license": "LGPL-3", +} diff --git a/pos_hide_partnerlist/static/src/js/HideCustomerList.js b/pos_hide_partnerlist/static/src/js/HideCustomerList.js new file mode 100644 index 0000000..f8e90b2 --- /dev/null +++ b/pos_hide_partnerlist/static/src/js/HideCustomerList.js @@ -0,0 +1,19 @@ +/** @odoo-module **/ + +import {Component} from "point_of_sale.Registries"; +import PartnerListScreen from "point_of_sale.PartnerListScreen"; + + +export const HidePartnerListScreen = (PartnerListScreen) => + class extends PartnerListScreen { + + get partners() { + if (!this.state.query ){ + return []; + } + return super.partners; + } + }; + + +Component.extend(PartnerListScreen, HidePartnerListScreen);