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

Agent and Contact list view not able to shown #1284

Closed
jecinthamary opened this issue Jun 23, 2023 · 8 comments
Closed

Agent and Contact list view not able to shown #1284

jecinthamary opened this issue Jun 23, 2023 · 8 comments

Comments

@jecinthamary
Copy link

  1. Agent and Contact list not able to view

pymysql.err.OperationalError: (1054, "Unknown column 'user.full_name' in 'field list'")

image

@ssiyad
Copy link
Contributor

ssiyad commented Jun 27, 2023

User is supposed to have a full name field. What is your Frappe framework version?

@jecinthamary
Copy link
Author

ERPNext: v14.27.9 (version-14)
Frappe Framework: v14.40.0 (version-14)
Helpdesk: v0.9.1 (main)

image

@ssiyad
Copy link
Contributor

ssiyad commented Jun 28, 2023

I can see Full Name field. Can you confirm if the field name is full_name? Can you check if such a field exist in DB?

@jecinthamary
Copy link
Author

User full name is present in DB level, and I installed fresh version 14, but the same error occurred.

@kurogeek
Copy link
Contributor

kurogeek commented Jul 5, 2023

After I did some investigate I found that the errors caused by following SQL Builder produces the wrong output.

Contact: SQL looks like this

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

As you can see name, email_id, image, and phone fields are ambiguous.

Agent: SQL looks like this.

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

As you can see there are user.full_name, user.user_image, etc, which user has never been defined. And, there are none of those fields inside tabHD Agent at all.

@safvanhuzain
Copy link

Is there any solution for that?

@kurogeek
Copy link
Contributor

PR Created on #1308, please check it out.

@nextchamp-saqib
Copy link
Member

Should be fixed with 24937ad

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 a pull request may close this issue.

5 participants