feat: add pagination, individual price sync arrows, and bulk price sync
- Pagination with page nav for mapped, unmatched Odoo, and unmatched WC tabs - Per-product arrow buttons to push price in either direction - Bulk price sync buttons: All Prices Odoo→WC and All Prices WC→Odoo - Server-side offset/limit with total count in search endpoints Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -82,12 +82,12 @@
|
||||
<button class="woo-tab" t-att-class="state.activeTab === 'mapped' ? 'active' : ''"
|
||||
t-on-click="() => this.setTab('mapped')">
|
||||
Mapped Products
|
||||
<span class="ms-1 woo-badge woo-badge-mapped" t-esc="state.mappedProducts.length"/>
|
||||
<span class="ms-1 woo-badge woo-badge-mapped" t-esc="state.mappedTotal"/>
|
||||
</button>
|
||||
<button class="woo-tab" t-att-class="state.activeTab === 'unmatched' ? 'active' : ''"
|
||||
t-on-click="() => this.setTab('unmatched')">
|
||||
Unmatched Products
|
||||
<span class="ms-1 woo-badge woo-badge-unmapped" t-esc="state.wooProducts.length"/>
|
||||
<span class="ms-1 woo-badge woo-badge-unmapped" t-esc="state.unmatchedWooTotal"/>
|
||||
</button>
|
||||
<button class="woo-tab" t-att-class="state.activeTab === 'conflicts' ? 'active' : ''"
|
||||
t-on-click="() => this.setTab('conflicts')">
|
||||
@@ -115,6 +115,12 @@
|
||||
t-att-disabled="!state.selectedMapped.length">
|
||||
<i class="fa fa-refresh me-1"/> Sync Selected
|
||||
</button>
|
||||
<button class="woo-btn woo-btn-secondary woo-btn-sm" t-on-click="bulkPriceOdooToWC">
|
||||
<i class="fa fa-arrow-right me-1"/> All Prices Odoo → WC
|
||||
</button>
|
||||
<button class="woo-btn woo-btn-secondary woo-btn-sm" t-on-click="bulkPriceWCToOdoo">
|
||||
<i class="fa fa-arrow-left me-1"/> All Prices WC → Odoo
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<t t-if="!state.mappedProducts.length">
|
||||
@@ -135,6 +141,7 @@
|
||||
<th>SKU</th>
|
||||
<th>Odoo Product</th>
|
||||
<th>WC Price</th>
|
||||
<th class="text-center"><i class="fa fa-exchange" title="Price Sync"/></th>
|
||||
<th>Odoo Price</th>
|
||||
<th>Instance</th>
|
||||
<th>Price Sync</th>
|
||||
@@ -153,6 +160,16 @@
|
||||
<td><span class="woo-code"><t t-esc="p.woo_sku"/></span></td>
|
||||
<td><t t-esc="p.odoo_product_name"/></td>
|
||||
<td class="text-end" t-esc="this.formatPrice(p.woo_price)"/>
|
||||
<td class="text-center woo-price-sync-col">
|
||||
<button class="woo-btn-icon" title="Push WC price to Odoo"
|
||||
t-on-click.stop="() => this.pushPriceToOdoo(p.id)">
|
||||
<i class="fa fa-arrow-right"/>
|
||||
</button>
|
||||
<button class="woo-btn-icon" title="Push Odoo price to WC"
|
||||
t-on-click.stop="() => this.pushPriceToWC(p.id)">
|
||||
<i class="fa fa-arrow-left"/>
|
||||
</button>
|
||||
</td>
|
||||
<td class="text-end" t-esc="this.formatPrice(p.odoo_price)"/>
|
||||
<td><t t-esc="p.instance_name"/></td>
|
||||
<td>
|
||||
@@ -170,6 +187,20 @@
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="woo-pagination">
|
||||
<button class="woo-btn woo-btn-secondary woo-btn-sm" t-on-click="mappedPrevPage"
|
||||
t-att-disabled="state.mappedPage <= 1">
|
||||
<i class="fa fa-chevron-left"/> Prev
|
||||
</button>
|
||||
<span class="woo-pagination-info">
|
||||
Page <t t-esc="state.mappedPage"/> of <t t-esc="mappedTotalPages"/>
|
||||
(<t t-esc="state.mappedTotal"/> total)
|
||||
</span>
|
||||
<button class="woo-btn woo-btn-secondary woo-btn-sm" t-on-click="mappedNextPage"
|
||||
t-att-disabled="state.mappedPage >= mappedTotalPages">
|
||||
Next <i class="fa fa-chevron-right"/>
|
||||
</button>
|
||||
</div>
|
||||
</t>
|
||||
</t>
|
||||
|
||||
@@ -219,6 +250,20 @@
|
||||
</div>
|
||||
</t>
|
||||
</div>
|
||||
<div class="woo-pagination">
|
||||
<button class="woo-btn woo-btn-secondary woo-btn-sm" t-on-click="unmatchedOdooPrevPage"
|
||||
t-att-disabled="state.unmatchedOdooPage <= 1">
|
||||
<i class="fa fa-chevron-left"/> Prev
|
||||
</button>
|
||||
<span class="woo-pagination-info">
|
||||
Page <t t-esc="state.unmatchedOdooPage"/> of <t t-esc="unmatchedOdooTotalPages"/>
|
||||
(<t t-esc="state.unmatchedOdooTotal"/> total)
|
||||
</span>
|
||||
<button class="woo-btn woo-btn-secondary woo-btn-sm" t-on-click="unmatchedOdooNextPage"
|
||||
t-att-disabled="state.unmatchedOdooPage >= unmatchedOdooTotalPages">
|
||||
Next <i class="fa fa-chevron-right"/>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Divider -->
|
||||
@@ -264,6 +309,20 @@
|
||||
</div>
|
||||
</t>
|
||||
</div>
|
||||
<div class="woo-pagination">
|
||||
<button class="woo-btn woo-btn-secondary woo-btn-sm" t-on-click="unmatchedWooPrevPage"
|
||||
t-att-disabled="state.unmatchedWooPage <= 1">
|
||||
<i class="fa fa-chevron-left"/> Prev
|
||||
</button>
|
||||
<span class="woo-pagination-info">
|
||||
Page <t t-esc="state.unmatchedWooPage"/> of <t t-esc="unmatchedWooTotalPages"/>
|
||||
(<t t-esc="state.unmatchedWooTotal"/> total)
|
||||
</span>
|
||||
<button class="woo-btn woo-btn-secondary woo-btn-sm" t-on-click="unmatchedWooNextPage"
|
||||
t-att-disabled="state.unmatchedWooPage >= unmatchedWooTotalPages">
|
||||
Next <i class="fa fa-chevron-right"/>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user