feat: add Cost and Margin % columns with inline editing
Cost column shows Odoo standard_price (editable). Margin % is calculated from cost and sale price. Editing margin auto-calculates the sale price using: price = cost / (1 - margin/100). All cells are inline-editable. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -144,6 +144,8 @@
|
||||
<th>WC Sale</th>
|
||||
<th class="text-center"><i class="fa fa-exchange" title="Price Sync"/></th>
|
||||
<th>Odoo Price</th>
|
||||
<th>Cost</th>
|
||||
<th>Margin %</th>
|
||||
<th>Instance</th>
|
||||
<th>Price Sync</th>
|
||||
<th>Inventory Sync</th>
|
||||
@@ -216,6 +218,28 @@
|
||||
</t>
|
||||
<t t-else="" t-esc="this.formatPrice(p.odoo_price)"/>
|
||||
</td>
|
||||
<td class="text-end woo-editable-cell" t-on-click.stop="() => this.startEdit(p.id, 'odoo_cost', p.odoo_cost)">
|
||||
<t t-if="this.isEditing(p.id, 'odoo_cost')">
|
||||
<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_cost)"/>
|
||||
</td>
|
||||
<td class="text-end woo-editable-cell woo-margin-cell" t-on-click.stop="() => this.startEdit(p.id, 'margin', this.calcMargin(p.odoo_cost, p.odoo_price))">
|
||||
<t t-if="this.isEditing(p.id, 'margin')">
|
||||
<input type="number" step="0.1" min="0" max="99.9" 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.formatMargin(p.odoo_cost, p.odoo_price)"/>
|
||||
</td>
|
||||
<td><t t-esc="p.instance_name"/></td>
|
||||
<td>
|
||||
<input type="checkbox"
|
||||
|
||||
Reference in New Issue
Block a user