Skip to content

The open alternative to Salesforce, designed for AI.

Fix object model settings label synchronization (#11708)

Paul Rastoin008356960651
diff --git a/packages/twenty-front/src/modules/settings/data-model/objects/forms/components/SettingsDataModelObjectAboutForm.tsx b/packages/twenty-front/src/modules/settings/data-model/objects/forms/components/SettingsDataModelObjectAboutForm.tsx
index 86f128896af..afbc3f9d932 100644
--- a/packages/twenty-front/src/modules/settings/data-model/objects/forms/components/SettingsDataModelObjectAboutForm.tsx
+++ b/packages/twenty-front/src/modules/settings/data-model/objects/forms/components/SettingsDataModelObjectAboutForm.tsx
@@ -100,7 +100,9 @@ export const SettingsDataModelObjectAboutForm = ({
setValue('labelPlural', labelPluralFromSingularLabel, {
shouldDirty: true,
});
- fillNamePluralFromLabelPlural(labelPluralFromSingularLabel);
+ if (isLabelSyncedWithName) {
+ fillNamePluralFromLabelPlural(labelPluralFromSingularLabel);
+ }
};
const fillNameSingularFromLabelSingular = (
@@ -318,17 +320,19 @@ export const SettingsDataModelObjectAboutForm = ({
advancedMode
onChange={(value) => {
onChange(value);
- onNewDirtyField?.();
-
+ const isCustomObject =
+ isDefined(objectMetadataItem) &&
+ objectMetadataItem.isCustom;
+ const isbeingCreatedObject =
+ !isDefined(objectMetadataItem);
if (
value === true &&
- ((isDefined(objectMetadataItem) &&
- objectMetadataItem.isCustom) ||
- !isDefined(objectMetadataItem))
+ (isCustomObject || isbeingCreatedObject)
) {
fillNamePluralFromLabelPlural(labelPlural);
fillNameSingularFromLabelSingular(labelSingular);
}
+ onNewDirtyField?.();
}}
/>
</Card>