From 468e3267ec579363dfeb5754528539b10706e54f Mon Sep 17 00:00:00 2001 From: luis Date: Mon, 12 May 2025 12:17:37 +0200 Subject: [PATCH] LaOsaCoop/Odoo16#14 add pos_hide_customerlist --- pos_hide_partnerlist/__init__.py | 0 pos_hide_partnerlist/__manifest__.py | 17 +++++++++++++++++ .../static/src/js/HideCustomerList.js | 19 +++++++++++++++++++ 3 files changed, 36 insertions(+) create mode 100644 pos_hide_partnerlist/__init__.py create mode 100644 pos_hide_partnerlist/__manifest__.py create mode 100644 pos_hide_partnerlist/static/src/js/HideCustomerList.js 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);