This commit is contained in:
gsinghpal
2026-04-02 17:55:32 -04:00
parent f715570e0c
commit 1c560c6df2
5 changed files with 87 additions and 8 deletions

View File

@@ -406,3 +406,6 @@
outline: none;
}
.woo-edit-input-text { text-align: left; width: 120px; }
/* Clear errors button inside dashboard card */
.woo-clear-btn { font-size: 0.72rem; padding: 1px 8px; }

View File

@@ -199,12 +199,23 @@ export class WooDashboard extends Component {
type: "ir.actions.act_window",
name: "Sync Errors (Last 24 h)",
res_model: "woo.sync.log",
view_mode: "list,form",
views: [[false, "list"], [false, "form"]],
domain: [["state", "=", "failed"]],
target: "current",
});
}
async clearErrors() {
const count = await rpc("/web/dataset/call_kw", {
model: "woo.sync.log",
method: "action_clear_errors",
args: [],
kwargs: {},
});
this.state.errors24h = 0;
this.notification.add(`${count} error log entries cleared.`, { type: "success" });
}
openConflicts() {
this.actionService.doAction("fusion_woocommerce.action_woo_conflict");
}

View File

@@ -50,7 +50,16 @@
<div class="woo-card-icon">⚠️</div>
<div class="woo-card-value" t-esc="state.errors24h"/>
<div class="woo-card-label">Errors (Last 24 h)</div>
<div class="woo-card-sub">Click to view sync log</div>
<div class="woo-card-sub d-flex align-items-center gap-2">
<span>Click to view sync log</span>
<t t-if="state.errors24h > 0">
<button class="btn btn-sm btn-outline-danger woo-clear-btn"
t-on-click.stop="clearErrors"
title="Clear all error logs">
<i class="fa fa-trash-o"/> Clear
</button>
</t>
</div>
</div>
<!-- Products mapped -->