From fce0369533dc2b16a9556533b19eaae2f573e748 Mon Sep 17 00:00:00 2001 From: Suherdy Yacob Date: Sat, 13 Jun 2026 23:04:22 +0700 Subject: [PATCH] refactor: reduce customer fetch limit from 100 to 25 in partner list sync --- static/src/app/screens/partner_list_patch.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/static/src/app/screens/partner_list_patch.js b/static/src/app/screens/partner_list_patch.js index a5a97d2..8c1c74d 100644 --- a/static/src/app/screens/partner_list_patch.js +++ b/static/src/app/screens/partner_list_patch.js @@ -24,17 +24,17 @@ patch(PartnerList.prototype, { } return; } - + try { this.state.loading = true; // console.log("[pos_loyalty_multi_level] Fetching the latest 100 customers from the backend..."); - + // In Odoo 19, data.searchRead fetches data AND creates/updates the local reactive models invisibly const newPartners = await this.pos.data.searchRead( - "res.partner", - [["active", "=", true]], - this.pos.data.fields["res.partner"], - { limit: 100, order: 'id desc' } + "res.partner", + [["active", "=", true]], + this.pos.data.fields["res.partner"], + { limit: 25, order: 'id desc' } ); let addedCount = 0; @@ -47,18 +47,18 @@ patch(PartnerList.prototype, { addedCount++; } } - + // Refresh initial view this.state.initialPartners = this.pos.models["res.partner"].filter((p) => { const par = p.property_account_receivable_id; return !par || par.non_trade !== true; }); - + if (this.notification) { this.notification.add(`Successfully synced list. Found ${addedCount} new customers.`, 3000); } // console.log(`[pos_loyalty_multi_level] Fetch complete. Added ${addedCount} customers to the session.`); - + } catch (e) { console.warn("[pos_loyalty_multi_level] Failed to update customer data:", e); if (this.notification) {