feat: sync partner search query with input and register patch template in assets

This commit is contained in:
Suherdy Yacob 2026-06-17 18:10:23 +07:00
parent b01cef8d22
commit 61c964b946
2 changed files with 18 additions and 0 deletions

View File

@ -23,6 +23,7 @@ Custom POS Loyalty and Membership management features:
],
'assets': {
'point_of_sale._assets_pos': [
'pos_loyalty_member_custom/static/src/app/screens/partner_list_patch.xml',
'pos_loyalty_member_custom/static/src/app/screens/partner_list_patch.js',
'pos_loyalty_member_custom/static/src/app/models/pos_order_patch.js',
]

View File

@ -7,10 +7,27 @@ import { normalize } from "@web/core/l10n/utils";
patch(PartnerList.prototype, {
setup() {
super.setup(...arguments);
this.state.inputQuery = "";
this._filteredLoyaltyCache = new Map();
this._partnersSearchCache = new Map();
},
onInputQueryChange(newValue) {
if (!newValue) {
this.state.query = "";
}
},
async searchPartner() {
this.state.query = this.state.inputQuery || "";
return super.searchPartner(...arguments);
},
async onEnter() {
this.state.query = this.state.inputQuery || "";
return super.onEnter(...arguments);
},
async editPartner() {
if (this._filteredLoyaltyCache) {
this._filteredLoyaltyCache.clear();