kid1194 / frappe-list-unassign-from

A Frappe plugin that adds the support of unassign from users for single and multiple list selection.
MIT License
3 stars 7 forks source link

ToDo name@example.com not found #3

Closed crazy-explore-r closed 1 year ago

crazy-explore-r commented 1 year ago

The below message is showing.

Screenshots image

kid1194 commented 1 year ago

@crazy-explore-r Thanks a lot buddy for reporting this..

If you can, please provide more information on how to reproduce this error so I can fix it..

Best regards..

crazy-explore-r commented 1 year ago

Hello @kid1194,

  1. In Role Doctype, I'm assigning a record to Administrator

image

image

  1. I can see that in Todo List image

  2. Now I am using the new option "Unassign From" in action menu from "Role" Doctype image

image

image

kid1194 commented 1 year ago

@crazy-explore-r I think that the error is thrown when trying to notify the user who assigned the ToDo so I have stopped this part for now..

Please update and give it another try then let me know if it's working or not..

Best regards..

crazy-explore-r commented 1 year ago

Hello @kid1194, Now it is working but, another issue is happening. PFB

In unassign popup, user select dropdown is not showing. image

The below error is showing in console. image

kid1194 commented 1 year ago

@crazy-explore-r Thanks a lot buddy for reporting this..

Now the users list error is fixed, the user notify that was disabled before is enabled and any thrown error will be posted to Frappe's error log doctype with the title "List Unassign From"..

Please update and give it another try then let me know if it's working or not..

Best regards..

crazy-explore-r commented 1 year ago

@kid1194,

I'm facing 2 issues,

  1. While I select a document and click on unassign from, the below popup is showing.

image

  1. I'm ignoring the popup and I'm checking the Unassign from me checkbox, then also the same error is showing.

image

Also find the server error below,

App Versions

{
    "erpnext": "14.31.1",
    "frappe": "14.41.0",
    "frappe_list_unassign_from": "1.0.7",
    "frappe_whatsapp": "0.0.2",
    "hrms": "14.6.1",
    "india_compliance": "14.12.0",
    "payments": "0.0.1"
}

Route

List/Leads/List

Traceback

Traceback (most recent call last):
  File "apps/frappe/frappe/app.py", line 94, in application
    response = frappe.api.handle()
  File "apps/frappe/frappe/api.py", line 54, in handle
    return frappe.handler.handle()
  File "apps/frappe/frappe/handler.py", line 47, in handle
    data = execute_cmd(cmd)
  File "apps/frappe/frappe/handler.py", line 85, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "apps/frappe/frappe/__init__.py", line 1619, in call
    return fn(*args, **newargs)
  File "apps/frappe/frappe/desk/search.py", line 37, in search_link
    search_widget(
  File "apps/frappe/frappe/desk/search.py", line 108, in search_widget
    raise e
  File "apps/frappe/frappe/desk/search.py", line 84, in search_widget
    is_whitelisted(frappe.get_attr(query))
  File "apps/frappe/frappe/__init__.py", line 1609, in get_attr
    return getattr(get_module(modulename), methodname)
  File "apps/frappe/frappe/__init__.py", line 1339, in get_module
    return importlib.import_module(modulename)
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "apps/frappe_list_unassign_from/frappe_list_unassign_from/api/__init__.py", line 7, in <module>
    from .unassign_from import *
  File "apps/frappe_list_unassign_from/frappe_list_unassign_from/api/unassign_from.py", line 107
    );
     ^
SyntaxError: invalid syntax

Request Data

{
    "type": "GET",
    "args": {
        "doctype": "Leads",
        "txt": "",
        "query": "frappe_list_unassign_from.api.search_link",
        "filters": "{\"docname\":[\"LEADID00272099\"]}"
    },
    "headers": {},
    "error_handlers": {},
    "url": "/api/method/frappe.desk.search.search_link"
}

Response Data

{
    "exception": "SyntaxError: invalid syntax"
}
kid1194 commented 1 year ago

@crazy-explore-r Sorry bro, it was a syntax mistake..

The above error alerts are because of this mistake. Thanks to you, it's fixed now..

Best regards..

crazy-explore-r commented 1 year ago

Hello @kid1194, Thanks for the Attributionā¤

Still facing issue while unassigning. The dropdown is not showing. Also there is no error in the console. image

kid1194 commented 1 year ago

@crazy-explore-r The attribution is the lest that I can do in return šŸ˜

I have updated the plugin..

The changes are:

  1. The "Unassign From" field in the dialog will only show the users who have a ToDo that is linked to one of the selected entries and the ToDo status is "Open"..
  2. The ToDo doctype in v13 is different than v14 so now the plugin check for frappe's version and handle the unassign action according to the version..

Please give it a try and let me know if it is still not working..

Best regards..

crazy-explore-r commented 1 year ago

@kid1194 , Issue is still persist. In unassign popup, dropdown is not showing for user list.

kid1194 commented 1 year ago

@crazy-explore-r Can you please do the following..

Open the dialog and type anything in the users list field and finally open the browser console and check if there is any log that starts with [UnassignFrom][Dialog]..

If a log is found, please post a screenshot of the console..

Best regards..

crazy-explore-r commented 1 year ago

While Assigning: image

While unassigning: Dropdown is not showing, but if I manually type the email id it is removing. The only problem is user list dropdown.

image

image

Thank You

kid1194 commented 1 year ago

@crazy-explore-r Previously I misunderstood the issue..

Thank you for clearing that out for me..

I will try to fix the dropdown issue and get back to you..

Best regards..

kid1194 commented 1 year ago

@crazy-explore-r I think that the dropdown was not showing or was taking some time to show is because the field query is done using a custom method..

Now I have made the code call the custom search method directly so it should be faster than before..

Best regards..

crazy-explore-r commented 1 year ago

App Versions

{
    "erpnext": "14.31.1",
    "frappe": "14.41.0",
    "frappe_list_unassign_from": "1.0.8",
    "hrms": "14.6.1",
    "india_compliance": "14.12.0",
    "payments": "0.0.1"
}

Route

List/User/List

Traceback

Traceback (most recent call last):
  File "apps/frappe/frappe/app.py", line 94, in application
    response = frappe.api.handle()
  File "apps/frappe/frappe/api.py", line 54, in handle
    return frappe.handler.handle()
  File "apps/frappe/frappe/handler.py", line 47, in handle
    data = execute_cmd(cmd)
  File "apps/frappe/frappe/handler.py", line 85, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "apps/frappe/frappe/__init__.py", line 1619, in call
    return fn(*args, **newargs)
  File "apps/frappe/frappe/desk/search.py", line 37, in search_link
    search_widget(
  File "apps/frappe/frappe/desk/search.py", line 108, in search_widget
    raise e
  File "apps/frappe/frappe/desk/search.py", line 85, in search_widget
    frappe.response["values"] = frappe.call(
  File "apps/frappe/frappe/__init__.py", line 1619, in call
    return fn(*args, **newargs)
TypeError: search_link() takes 3 positional arguments but 6 were given

Request Data

{
    "type": "GET",
    "args": {
        "doctype": "User",
        "txt": "",
        "query": "frappe_list_unassign_from.api.search_link",
        "filters": "{\"docnames\":[\"developer.ragul@gmail.com\"]}"
    },
    "headers": {},
    "error_handlers": {},
    "url": "/api/method/frappe.desk.search.search_link"
}

Response Data

{
    "exception": "TypeError: search_link() takes 3 positional arguments but 6 were given"
}
kid1194 commented 1 year ago

@crazy-explore-r Bro, did you update the plugin?

I think that the error is cache related since the plugin now doesn't rely on "api/method/frappe.desk.search.search_link"..

It sends the request directly to the custom method..

This is the old request..

{
    "type": "GET",
    "args": {
        "doctype": "User",
        "txt": "",
        "query": "frappe_list_unassign_from.api.search_link",
        "filters": "{\"docnames\":[\"developer.ragul@gmail.com\"]}"
    },
    "headers": {},
    "error_handlers": {},
    "url": "/api/method/frappe.desk.search.search_link"
}

This is the new request..

{
    "type": "POST",
    "args": {
        "doctype": "User",
        "txt": "",
        "filters": "{\"docnames\":[\"developer.ragul@gmail.com\"]}"
    },
    "headers": {},
    "error_handlers": {},
    "url": "/api/method/frappe_list_unassign_from.api.search_link"
}

Best regards..

crazy-explore-r commented 1 year ago

Hello @kid1194, Now the error is not showing. Also the dropdown is not showing.

kid1194 commented 1 year ago

@crazy-explore-r There is something wrong going with the request, so for now I used frappe's code which fetches all users..

Please give it a try..

Best regards..

crazy-explore-r commented 1 year ago

Awesome Bro it is working as expected. Thanks A Lotā¤

kid1194 commented 1 year ago

@crazy-explore-r I'm glad that it finally worked..

Thanks a lot brother for your patience and help..

Best regards..