feat: sync partner search query with input and register patch template in assets
This commit is contained in:
parent
b01cef8d22
commit
61c964b946
@ -23,6 +23,7 @@ Custom POS Loyalty and Membership management features:
|
|||||||
],
|
],
|
||||||
'assets': {
|
'assets': {
|
||||||
'point_of_sale._assets_pos': [
|
'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/screens/partner_list_patch.js',
|
||||||
'pos_loyalty_member_custom/static/src/app/models/pos_order_patch.js',
|
'pos_loyalty_member_custom/static/src/app/models/pos_order_patch.js',
|
||||||
]
|
]
|
||||||
|
|||||||
@ -7,10 +7,27 @@ import { normalize } from "@web/core/l10n/utils";
|
|||||||
patch(PartnerList.prototype, {
|
patch(PartnerList.prototype, {
|
||||||
setup() {
|
setup() {
|
||||||
super.setup(...arguments);
|
super.setup(...arguments);
|
||||||
|
this.state.inputQuery = "";
|
||||||
this._filteredLoyaltyCache = new Map();
|
this._filteredLoyaltyCache = new Map();
|
||||||
this._partnersSearchCache = 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() {
|
async editPartner() {
|
||||||
if (this._filteredLoyaltyCache) {
|
if (this._filteredLoyaltyCache) {
|
||||||
this._filteredLoyaltyCache.clear();
|
this._filteredLoyaltyCache.clear();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user