Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: project query controller logic #39402

Merged
merged 3 commits into from
Jan 16, 2024

Conversation

ruthra-kumar
Copy link
Member

@ruthra-kumar ruthra-kumar commented Jan 16, 2024

Fixes broken/incorrect results on 'Project' field in Sales Order and Delivery Note.

Issues addressed:

  1. Completed/Cancelled project's are returned in result
  2. Projects aren't filters on Customer, even after selecting it in form

@ruthra-kumar
Copy link
Member Author

@SvbZ3r0

@ruthra-kumar ruthra-kumar merged commit ca9413b into frappe:develop Jan 16, 2024
10 of 12 checks passed
ruthra-kumar added a commit that referenced this pull request Jan 16, 2024
…-39402

fix: project query controller logic (backport #39402)
@SvbZ3r0
Copy link
Contributor

SvbZ3r0 commented Jan 16, 2024

status and customer filters are set in Sales Order and Delivery Note.
However, Sales Invoice, Purchase Order and Purchase Invoice function as before.

Is that intended?

@ruthra-kumar
Copy link
Member Author

@SvbZ3r0

status and customer filters are set in Sales Order and Delivery Note.

Yes. This PR is only to address the broken sql query in queries.py.
Ex: Status and Customer was filtered with an OR condition by the searchfields logic, which led to cancelled/completed projects or customer filter not being applied as intended.

searchfields = frappe.get_meta(doctype).get_search_fields()
searchfields = " or ".join(["`tabProject`." + field + " like %(txt)s" for field in searchfields])

However, Sales Invoice, Purchase Order and Purchase Invoice function as before.
Is that intended?

For SI, PO and PI's, simply adding a set_query should be enough now, which is to be done in a separate PR

@SvbZ3r0
Copy link
Contributor

SvbZ3r0 commented Jan 16, 2024

Thanks 👍🏽

ruthra-kumar added a commit that referenced this pull request Jan 17, 2024
…-39402

fix: project query controller logic (backport #39402)
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport version-14-hotfix backport to version 14 backport version-15-hotfix needs-tests This PR needs automated unit-tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants