Files
Odoo-Modules/fusion_claims/static/src/js/debug_required_fields.js
gsinghpal b925766966 changes
2026-02-27 14:32:32 -05:00

21 lines
786 B
JavaScript

/** @odoo-module **/
import { Record } from "@web/model/relational_model/record";
import { patch } from "@web/core/utils/patch";
patch(Record.prototype, {
_displayInvalidFieldNotification() {
const fieldNames = [];
for (const fieldName of this._invalidFields) {
const fieldDef = this.fields[fieldName];
const label = fieldDef?.string || fieldName;
fieldNames.push(`${label} (${fieldName})`);
}
const message = fieldNames.length
? `Missing required fields:\n${fieldNames.join(", ")}`
: "Missing required fields (unknown)";
console.error("FUSION DEBUG:", message, Array.from(this._invalidFields));
return this.model.notification.add(message, { type: "danger" });
},
});