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: list agent and contact #1308

Closed
wants to merge 3 commits into from

Conversation

kurogeek
Copy link
Contributor

This is the best I can do to fix #1284

singhranbir

This comment was marked as off-topic.

@codecov
Copy link

codecov bot commented Jul 24, 2023

Codecov Report

Patch coverage has no change and project coverage change: +0.41 🎉

Comparison is base (75e655f) 12.87% compared to head (16a912e) 13.29%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1308      +/-   ##
==========================================
+ Coverage   12.87%   13.29%   +0.41%     
==========================================
  Files          52       56       +4     
  Lines        1848     1963     +115     
==========================================
+ Hits          238      261      +23     
- Misses       1610     1702      +92     
Impacted Files Coverage Δ
helpdesk/__init__.py 100.00% <ø> (ø)
helpdesk/consts.py 100.00% <ø> (ø)
helpdesk/helpdesk/doctype/hd_agent/hd_agent.py 0.00% <ø> (ø)
helpdesk/helpdesk/doctype/hd_article/hd_article.py 0.00% <ø> (ø)
...hd_desk_account_request/hd_desk_account_request.py 0.00% <ø> (ø)
...k/doctype/hd_escalation_rule/hd_escalation_rule.py 0.00% <ø> (ø)
helpdesk/helpdesk/doctype/hd_ticket/hd_ticket.py 22.82% <ø> (+0.30%) ⬆️
...esk/doctype/hd_ticket_comment/hd_ticket_comment.py 0.00% <ø> (ø)
...k/doctype/hd_ticket_template/hd_ticket_template.py 0.00% <ø> (ø)
.../helpdesk/doctype/hd_ticket_type/hd_ticket_type.py 0.00% <ø> (ø)
... and 1 more

... and 3 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@ssiyad
Copy link
Contributor

ssiyad commented Jul 25, 2023

@kurogeek can you please explain the root cause? Also, does this happen in both v14 and v15?

@kurogeek
Copy link
Contributor Author

I haven't tested on v15 yet, so I don't know this happens on v15 or not.

As I mention on this #1284 (comment), the issue cause by SQL builder is producing the wrong SQL query that contain ambiguous fields and undefined name.

SELECT 
`name`,`email_id`,`image`,`phone`,`tabContact`.`first_name`,`tabContact`.`last_name`,`tabContact Email`.`email_id`,`tabContact Phone`.`phone`,`tabDynamic Link`.`link_name` 
FROM `tabContact` 
LEFT JOIN `tabContact Email` 
    ON `tabContact Email`.`parent`=`tabContact`.`name` 
LEFT JOIN `tabContact Phone` 
    ON `tabContact Phone`.`parent`=`tabContact`.`name` 
LEFT JOIN `tabDynamic Link` 
    ON `tabDynamic Link`.`parent`=`tabContact`.`name` 
ORDER BY `tabContact`.`modified` DESC,`tabContact`.`modified` DESC LIMIT 20

name, email_id, image, and phone fields are ambiguous.

SELECT `name`,`is_active`,`user.full_name`,`user.user_image`,`user.email`,`user.username` 
FROM `tabHD Agent` 
ORDER BY `modified` DESC,`modified` DESC LIMIT 20

From this SQL query, the user has never been defined.

And after more investigation, I found that rather than fixing the SQL builder, it would be simpler to just query all the fields with * then pick the columns to show using column const.

@nextchamp-saqib
Copy link
Member

nextchamp-saqib commented Jul 30, 2023

Fixed with 24937ad

@kurogeek
Copy link
Contributor Author

kurogeek commented Aug 1, 2023

@nextchamp-saqib This is not fixed. Since there are incoming issues about this problem. #1413 #1418

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.

Agent and Contact list view not able to shown
4 participants