changes
This commit is contained in:
20
fusion_claims/static/src/js/debug_required_fields.js
Normal file
20
fusion_claims/static/src/js/debug_required_fields.js
Normal file
@@ -0,0 +1,20 @@
|
||||
/** @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" });
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user