[FIX] web: properties, fix the label requirement check
Bug === The labels of the properties and their names are always required, the check was wrongly done and still used the historical name "id" instead of "name". If a property value is missing, the color of the label is marked in red. But the datepicker and dropdown are also in read which we don't want (only the label). Task-3188915 closes odoo/odoo#133479 X-original-commit: 5c0720743d299eec305a025d20201103f9f45dc5 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit is contained in:
@@ -331,6 +331,22 @@ export class Record extends DataPoint {
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "properties": {
|
||||
const value = this.data[fieldName];
|
||||
if (value) {
|
||||
const ok = value.every(
|
||||
(propertyDefinition) =>
|
||||
propertyDefinition.name &&
|
||||
propertyDefinition.name.length &&
|
||||
propertyDefinition.string &&
|
||||
propertyDefinition.string.length
|
||||
);
|
||||
if (!ok) {
|
||||
unsetRequiredFields.push(fieldName);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
if (!this.data[fieldName] && this._isRequired(fieldName)) {
|
||||
unsetRequiredFields.push(fieldName);
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
.o_dropdown_button,
|
||||
.o_datepicker_button {
|
||||
@include print-variable(o-input-border-color, $o-form-lightsecondary);
|
||||
color: $o-main-text-color !important;
|
||||
}
|
||||
.o_dropdown_button,
|
||||
.o_datepicker_button {
|
||||
|
||||
Reference in New Issue
Block a user