Skip to content

OBGM-416 Unable to use product filter on add items to PO shipment#4095

Merged
awalkowiak merged 3 commits intofeature/upgrade-to-grails-3.3.10from
OBGM-416-2
Jun 7, 2023
Merged

OBGM-416 Unable to use product filter on add items to PO shipment#4095
awalkowiak merged 3 commits intofeature/upgrade-to-grails-3.3.10from
OBGM-416-2

Conversation

@alannadolny
Copy link
Collaborator

No description provided.

@alannadolny alannadolny self-assigned this Jun 7, 2023
def getProductsInOrders(String[] terms, Location destination, Location vendor) {
return OrderItem.createCriteria().list {
createAlias('product', 'prod', JoinType.LEFT_OUTER_JOIN)
createAlias('product.synonyms', 'syn', JoinType.LEFT_OUTER_JOIN)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

out of curosity it'd be worth also to check if here prod.synonyms would work

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, it works

ilike("prod.name", "%" + term)
and {
ilike("syn.name", "%" + term)
eq("syn.synonymTypeCode", SynonymTypeCode.DISPLAY_NAME)
Copy link
Collaborator

@kchelstowski kchelstowski Jun 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you fix the indent here, so it's not acting like it's nested inside ilike?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's acting as it should, not like nested inside ilike

Copy link
Collaborator

@kchelstowski kchelstowski Jun 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know it's acting like it should. maybe "pretending" work would be more appropiate - someone might be confused when reading the code with such an indent 😄 - that's what I meant

@alannadolny alannadolny requested a review from kchelstowski June 7, 2023 13:40

def getProductsInOrders(String[] terms, Location destination, Location vendor) {
return OrderItem.createCriteria().list {
createAlias('product', 'prod', JoinType.LEFT_OUTER_JOIN)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make these aliases a product and synonym instead of prod and syn

@alannadolny alannadolny requested a review from awalkowiak June 7, 2023 13:57
@awalkowiak awalkowiak merged commit f9181d1 into feature/upgrade-to-grails-3.3.10 Jun 7, 2023
@awalkowiak awalkowiak deleted the OBGM-416-2 branch June 7, 2023 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants