feat: variant push wizard — review pricing, SKU, images before pushing
Replaced direct push with a wizard that shows all variants in an editable table. User can review/edit standard price, sale price, SKU, and image per variant before pushing. Include/exclude toggle per variant. Already synced variants shown for reference. Geo-tags images if configured. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -860,22 +860,24 @@ export class ProductMapping extends Component {
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
async pushVariantsToWC(mapId) {
|
||||
try {
|
||||
this.state.loading = true;
|
||||
await rpc("/web/dataset/call_kw", {
|
||||
model: "woo.product.map",
|
||||
method: "action_push_variants_to_wc",
|
||||
args: [[mapId]],
|
||||
kwargs: {},
|
||||
});
|
||||
this.notification.add("Variants pushed to WooCommerce successfully.", { type: "success" });
|
||||
await this._refreshAll();
|
||||
} catch (err) {
|
||||
console.error("[ProductMapping] pushVariantsToWC error:", err);
|
||||
this.notification.add(err.message || "Failed to push variants.", { type: "danger" });
|
||||
} finally {
|
||||
this.state.loading = false;
|
||||
if (!this.state.instanceId) {
|
||||
this.notification.add("Select an instance first.", { type: "warning" });
|
||||
return;
|
||||
}
|
||||
this.actionService.doAction({
|
||||
type: 'ir.actions.act_window',
|
||||
res_model: 'woo.variant.push.wizard',
|
||||
views: [[false, 'form']],
|
||||
target: 'new',
|
||||
context: {
|
||||
default_instance_id: this.state.instanceId,
|
||||
default_product_map_id: mapId,
|
||||
},
|
||||
}, {
|
||||
onClose: async () => {
|
||||
await this._refreshAll();
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user