diff --git a/addons/web/static/src/views/fields/properties/properties_field.js b/addons/web/static/src/views/fields/properties/properties_field.js index bc6ca85906c..440d063854c 100644 --- a/addons/web/static/src/views/fields/properties/properties_field.js +++ b/addons/web/static/src/views/fields/properties/properties_field.js @@ -236,10 +236,11 @@ export class PropertiesField extends Component { async onPropertyEdit(event, propertyName) { event.stopPropagation(); event.preventDefault(); - if (!await this.checkDefinitionWriteAccess()) { - this.notification.add(_lt("You need to be able to edit parent first to configure property fields"), { - type: "warning", - }); + if (!(await this.checkDefinitionWriteAccess())) { + this.notification.add( + _lt("You need to be able to edit parent first to configure property fields"), + { type: "warning" } + ); return; } if (event.target.classList.contains("disabled")) { @@ -300,10 +301,11 @@ export class PropertiesField extends Component { } async onPropertyCreate() { - if (!await this.checkDefinitionWriteAccess()) { - this.notification.add(_lt("You need to be able to edit parent first to configure property fields"), { - type: "warning", - }); + if (!(await this.checkDefinitionWriteAccess())) { + this.notification.add( + _lt("You need to be able to edit parent first to configure property fields"), + { type: "warning" } + ); return; } const propertiesDefinitions = this.propertiesList || []; @@ -348,11 +350,9 @@ export class PropertiesField extends Component { this.definitionRecordModel, "check_access_rule", [this.definitionRecordId], - { - operation: "write", - } + { operation: "write" } ); - } catch (_e) { // eslint-disable-line no-unused-vars + } catch { return false; } return true; diff --git a/addons/web/static/src/views/fields/properties/property_tags.js b/addons/web/static/src/views/fields/properties/property_tags.js index ddfc80732a2..8ea9e3b77a8 100644 --- a/addons/web/static/src/views/fields/properties/property_tags.js +++ b/addons/web/static/src/views/fields/properties/property_tags.js @@ -193,10 +193,11 @@ export class PropertyTags extends Component { return; } - if (!await this.props.checkDefinitionWriteAccess()) { - this.notification.add(_lt("You need to be able to edit parent first to add property tags"), { - type: "warning", - }); + if (!(await this.props.checkDefinitionWriteAccess())) { + this.notification.add( + _lt("You need to be able to edit parent first to add property tags"), + { type: "warning" } + ); return; }