From ded123b65fc4235ea63c3214d0bf672fde92b78f Mon Sep 17 00:00:00 2001 From: std-odoo Date: Thu, 20 Apr 2023 06:17:58 +0000 Subject: [PATCH] [FIX] web: properties, respect prettier standard Purpose ======= All the properties field file respect prettier rules defined in /web/tooling (like normal field), during odoo/odoo#118929 we forgot to apply those rules. Task-3188915 closes odoo/odoo#119811 Related: odoo/enterprise#40363 Signed-off-by: Thibault Delavallee (tde) --- .../fields/properties/properties_field.js | 24 +++++++++---------- .../views/fields/properties/property_tags.js | 9 +++---- 2 files changed, 17 insertions(+), 16 deletions(-) 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; }