Skip to content

Commit

Permalink
fix: contact and partner mutually dependent
Browse files Browse the repository at this point in the history
  • Loading branch information
gca-axelor committed Dec 11, 2024
1 parent 5304ff6 commit 0b82d7c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions changelogs/unreleased/88244.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"title": "Opportunity form: make contact and partner fields mutually dependent",
"type": "fix",
"packages": "crm"
}
7 changes: 6 additions & 1 deletion packages/apps/crm/src/models/forms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,11 @@ export const crm_formsRegister: FormConfigs = {
widget: 'custom',
customComponent: ClientProspectSearchBar,
required: true,
dependsOn: {
contact: ({newValue}) => {
return newValue?.mainPartner;
},
},
},
contact: {
titleKey: 'Crm_Contact',
Expand All @@ -311,7 +316,7 @@ export const crm_formsRegister: FormConfigs = {
options: {
showTitle: true,
},
required: true,
requiredIf: ({objectState}) => objectState.partner == null,
},
expectedCloseDate: {
titleKey: 'Crm_Opportunity_ExpectedCloseDate',
Expand Down

0 comments on commit 0b82d7c

Please sign in to comment.