Skip to content

Commit

Permalink
fix: manage null case on company criterias
Browse files Browse the repository at this point in the history
  • Loading branch information
lme-axelor committed Dec 19, 2024
1 parent 55ca23f commit dc1885e
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions packages/core/src/apiProviders/Standard/requests.helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,18 @@ export const getCompanyCriteria = (
companyFieldName: string = 'company',
): Criteria => {
return {
fieldName: `${companyFieldName}.id`,
operator: '=',
value: companyId,
operator: 'or',
criteria: [
{
fieldName: `${companyFieldName}`,
operator: 'isNull',
},
{
fieldName: `${companyFieldName}.id`,
operator: '=',
value: companyId,
},
],
};
};

Expand All @@ -193,7 +202,7 @@ export const getCompanyDomain = (
companySetFieldName: string = 'companySet',
): Domain => {
return {
domain: `:company MEMBER OF self.${companySetFieldName}`,
domain: `self.${companySetFieldName} IS EMPTY OR :company MEMBER OF self.${companySetFieldName}`,
domainContext: {
company: {
id: companyId,
Expand Down

0 comments on commit dc1885e

Please sign in to comment.