feat: add editable WC SKU and Odoo SKU columns with bidirectional sync

Both SKU fields are inline-editable. Arrow buttons sync individual SKUs.
Bulk buttons sync all SKUs Odoo→WC or WC→Odoo.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsinghpal
2026-04-01 13:32:26 -04:00
parent 1a1a37b3e3
commit 3179cc1f7b
5 changed files with 230 additions and 12 deletions

View File

@@ -121,6 +121,12 @@
<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>
<button class="woo-btn woo-btn-secondary woo-btn-sm" t-on-click="bulkSkuOdooToWC">
<i class="fa fa-arrow-right me-1"/> All SKUs Odoo → WC
</button>
<button class="woo-btn woo-btn-secondary woo-btn-sm" t-on-click="bulkSkuWCToOdoo">
<i class="fa fa-arrow-left me-1"/> All SKUs WC → Odoo
</button>
</div>
<t t-if="!state.mappedProducts.length">
@@ -138,7 +144,9 @@
<input type="checkbox" t-on-change="toggleSelectAllMapped"/>
</th>
<th>WooCommerce Product</th>
<th>SKU</th>
<th>WC SKU</th>
<th class="text-center"><i class="fa fa-exchange" title="SKU Sync"/></th>
<th>Odoo SKU</th>
<th>Odoo Product</th>
<th>WC Standard</th>
<th>WC Sale</th>
@@ -168,7 +176,38 @@
</t>
<t t-else=""><t t-esc="p.woo_product_name"/></t>
</td>
<td><span class="woo-code"><t t-esc="p.woo_sku"/></span></td>
<td class="woo-editable-cell" t-on-click.stop="() => this.startEdit(p.id, 'wc_sku', p.woo_sku)">
<t t-if="this.isEditing(p.id, 'wc_sku')">
<input type="text" class="woo-edit-input woo-edit-input-text"
t-att-value="state.editValue"
t-on-input="onEditInput"
t-on-keydown="onEditKeydown"
t-on-blur="onEditBlur"
/>
</t>
<t t-else=""><span class="woo-code"><t t-esc="p.woo_sku"/></span></t>
</td>
<td class="text-center woo-price-sync-col">
<button class="woo-btn-icon" title="Push WC SKU to Odoo"
t-on-click.stop="() => this.pushSkuToOdoo(p.id)">
<i class="fa fa-arrow-right"/>
</button>
<button class="woo-btn-icon" title="Push Odoo SKU to WC"
t-on-click.stop="() => this.pushSkuToWC(p.id)">
<i class="fa fa-arrow-left"/>
</button>
</td>
<td class="woo-editable-cell" t-on-click.stop="() => this.startEdit(p.id, 'odoo_sku', p.odoo_default_code)">
<t t-if="this.isEditing(p.id, 'odoo_sku')">
<input type="text" class="woo-edit-input woo-edit-input-text"
t-att-value="state.editValue"
t-on-input="onEditInput"
t-on-keydown="onEditKeydown"
t-on-blur="onEditBlur"
/>
</t>
<t t-else=""><span class="woo-code"><t t-esc="p.odoo_default_code"/></span></t>
</td>
<td><t t-esc="p.odoo_product_name"/></td>
<td class="text-end woo-editable-cell" t-on-click.stop="() => this.startEdit(p.id, 'woo_regular', p.woo_regular_price)">
<t t-if="this.isEditing(p.id, 'woo_regular')">