[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) <tde@openerp.com>
This commit is contained in:
std-odoo
2023-05-03 10:11:54 +02:00
parent abf487fcd7
commit ded123b65f
2 changed files with 17 additions and 16 deletions
@@ -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;
@@ -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;
}