feat: category filter dropdown on unmatched Odoo products panel

Filter by Odoo product category or clear filter. Backend supports
both include and exclude category filtering. Loads all categories
on init for the dropdown.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsinghpal
2026-04-01 15:56:13 -04:00
parent 9f0badfb7e
commit 52be90c10d
4 changed files with 119 additions and 2 deletions

View File

@@ -333,8 +333,24 @@
<div class="woo-split">
<!-- Odoo products panel -->
<div class="woo-split-panel">
<div class="woo-split-panel-header">
<div class="woo-split-panel-header" style="flex-wrap: wrap; gap: 6px;">
<span>Odoo Products</span>
<div class="d-flex gap-2 align-items-center">
<select class="woo-filter-select" t-on-change="onOdooCategoryFilter">
<option value="">All Categories</option>
<t t-foreach="state.odooCategories" t-as="cat" t-key="cat.id">
<option t-att-value="cat.id"
t-att-selected="state.odooFilterCategoryId === cat.id">
<t t-esc="cat.complete_name"/>
</option>
</t>
</select>
<t t-if="state.odooFilterCategoryId || state.odooExcludeCategoryIds.length">
<button class="woo-btn-icon" title="Clear filter" t-on-click="clearCategoryFilter">
<i class="fa fa-times"/>
</button>
</t>
</div>
<AjaxSearch
endpoint="'/woo/search/odoo_products'"
t-props="{ instanceId: state.instanceId, onResults: onOdooResults.bind(this), placeholder: 'Search Odoo…' }"