feat: inline-editable prices in product mapping UI
Click any price cell (WC Standard, WC Sale, Odoo Price) to edit inline. Enter or click away saves and syncs to the source. Escape cancels. Validation: sale price cannot exceed standard price. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -168,12 +168,32 @@
|
||||
</td>
|
||||
<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_regular_price)"/>
|
||||
<td class="text-end">
|
||||
<t t-if="p.woo_sale_price">
|
||||
<span class="woo-sale-price" t-esc="this.formatPrice(p.woo_sale_price)"/>
|
||||
<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')">
|
||||
<input type="number" step="0.01" min="0" class="woo-edit-input"
|
||||
t-att-value="state.editValue"
|
||||
t-on-input="onEditInput"
|
||||
t-on-keydown="onEditKeydown"
|
||||
t-on-blur="onEditBlur"
|
||||
/>
|
||||
</t>
|
||||
<t t-else="" t-esc="this.formatPrice(p.woo_regular_price)"/>
|
||||
</td>
|
||||
<td class="text-end woo-editable-cell" t-on-click.stop="() => this.startEdit(p.id, 'woo_sale', p.woo_sale_price)">
|
||||
<t t-if="this.isEditing(p.id, 'woo_sale')">
|
||||
<input type="number" step="0.01" min="0" class="woo-edit-input"
|
||||
t-att-value="state.editValue"
|
||||
t-on-input="onEditInput"
|
||||
t-on-keydown="onEditKeydown"
|
||||
t-on-blur="onEditBlur"
|
||||
/>
|
||||
</t>
|
||||
<t t-else="">
|
||||
<t t-if="p.woo_sale_price">
|
||||
<span class="woo-sale-price" t-esc="this.formatPrice(p.woo_sale_price)"/>
|
||||
</t>
|
||||
<t t-else=""><span class="woo-text-muted">—</span></t>
|
||||
</t>
|
||||
<t t-else=""><span class="woo-text-muted">—</span></t>
|
||||
</td>
|
||||
<td class="text-center woo-price-sync-col">
|
||||
<button class="woo-btn-icon" title="Push WC price to Odoo"
|
||||
@@ -185,7 +205,17 @@
|
||||
<i class="fa fa-arrow-left"/>
|
||||
</button>
|
||||
</td>
|
||||
<td class="text-end" t-esc="this.formatPrice(p.odoo_price)"/>
|
||||
<td class="text-end woo-editable-cell" t-on-click.stop="() => this.startEdit(p.id, 'odoo_price', p.odoo_price)">
|
||||
<t t-if="this.isEditing(p.id, 'odoo_price')">
|
||||
<input type="number" step="0.01" min="0" class="woo-edit-input"
|
||||
t-att-value="state.editValue"
|
||||
t-on-input="onEditInput"
|
||||
t-on-keydown="onEditKeydown"
|
||||
t-on-blur="onEditBlur"
|
||||
/>
|
||||
</t>
|
||||
<t t-else="" t-esc="this.formatPrice(p.odoo_price)"/>
|
||||
</td>
|
||||
<td><t t-esc="p.instance_name"/></td>
|
||||
<td>
|
||||
<input type="checkbox"
|
||||
|
||||
Reference in New Issue
Block a user