feat: persistent hidden categories with wizard and toggle

Categories to hide are stored on woo.instance and persist across sessions.
Click 'Hidden (N)' button to open wizard where you can add/remove categories
using a tag picker. Eye/eye-slash toggle to quickly apply or unapply the
filter without losing the saved list.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsinghpal
2026-04-01 16:06:15 -04:00
parent 52be90c10d
commit 5e806745da
9 changed files with 138 additions and 48 deletions

View File

@@ -336,18 +336,20 @@
<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>
<button class="woo-btn woo-btn-secondary woo-btn-sm"
t-on-click="openCategoryFilter"
title="Manage hidden categories">
<i class="fa fa-filter me-1"/>
Hidden
<t t-if="state.excludedCategoryCount">
(<t t-esc="state.excludedCategoryCount"/>)
</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 t-if="state.excludedCategoryCount">
<button t-att-class="'woo-btn woo-btn-sm ' + (state.categoryFilterActive ? 'woo-btn-primary' : 'woo-btn-secondary')"
t-on-click="toggleCategoryFilter"
t-att-title="state.categoryFilterActive ? 'Filter active — click to show all' : 'Filter off — click to hide categories'">
<i t-att-class="'fa ' + (state.categoryFilterActive ? 'fa-eye-slash' : 'fa-eye')"/>
</button>
</t>
</div>