Not Permitted Message for New Quotation and Sales Order

Using the role Sales User only i get this error message when creating new document in Quotation and Sales Order.

Though i am still able to access the functions normally without restriction. I wonder which permissions in the doctype i have to change to remove the message. Using my full role account i do not get this message.

Is there a way to trace the permissions?

The error i get in console. What does it mean?

Traceback (most recent call last):
  File "/home/administrator/frappe-bench/apps/frappe/frappe/app.py", line 57, in application
    response = frappe.handler.handle()
  File "/home/administrator/frappe-bench/apps/frappe/frappe/handler.py", line 22, in handle
    data = execute_cmd(cmd)
  File "/home/administrator/frappe-bench/apps/frappe/frappe/handler.py", line 53, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "/home/administrator/frappe-bench/apps/frappe/frappe/__init__.py", line 923, in call
    return fn(*args, **newargs)
  File "/home/administrator/frappe-bench/apps/frappe/frappe/client.py", line 60, in get_value
    frappe.throw(_("Not permitted"), frappe.PermissionError)
  File "/home/administrator/frappe-bench/apps/frappe/frappe/__init__.py", line 319, in throw
    msgprint(msg, raise_exception=exc, title=title, indicator='red')
  File "/home/administrator/frappe-bench/apps/frappe/frappe/__init__.py", line 309, in msgprint
    _raise_exception()
  File "/home/administrator/frappe-bench/apps/frappe/frappe/__init__.py", line 282, in _raise_exception
    raise raise_exception(encode(msg))
PermissionError: Not permitted

Do you have a custom script? Or maybe you don’t have permissions for the default Tax Template or something. We will fix the message to be more descriptive!

I don’t have custom scripts. Only custom fields. User has permission for Sales Taxes and Charges Template.

@rmehta
i have the same issue exactly and its for any new document have link drop down menu creation, this not the only issue their are some issue in V9 also i have attached what i have meet so far waiting your feedback Please .

Traceback (most recent call last):
  File "/home/administrator/frappe-bench/apps/frappe/frappe/app.py", line 57, in application
    response = frappe.handler.handle()
  File "/home/administrator/frappe-bench/apps/frappe/frappe/handler.py", line 22, in handle
    data = execute_cmd(cmd)
  File "/home/administrator/frappe-bench/apps/frappe/frappe/handler.py", line 53, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "/home/administrator/frappe-bench/apps/frappe/frappe/__init__.py", line 923, in call
    return fn(*args, **newargs)
  File "/home/administrator/frappe-bench/apps/frappe/frappe/core/doctype/user/user.py", line 567, in test_password_strength
    result = _test_password_strength(new_password, user_inputs=user_data)
  File "/home/administrator/frappe-bench/apps/frappe/frappe/utils/password_strength.py", line 13, in test_password_strength
    result['feedback'] = get_feedback(result['score'], result['sequence'])
  File "/home/administrator/frappe-bench/apps/frappe/frappe/utils/password_strength.py", line 52, in get_feedback
    feedback = get_match_feedback(longest_match, len(sequence) == 1)
  File "/home/administrator/frappe-bench/apps/frappe/frappe/utils/password_strength.py", line 141, in get_match_feedback
    return(pattern_fn())
  File "/home/administrator/frappe-bench/apps/frappe/frappe/utils/password_strength.py", line 72, in fun_dictionary
    return get_dictionary_match_feedback(match, is_sole_match)
  File "/home/administrator/frappe-bench/apps/frappe/frappe/utils/password_strength.py", line 177, in get_dictionary_match_feedback
    if match["l33t_entropy"]:
KeyError: u'l33t_entropy'
[ERROR] 2017-10-12 21:32:18,195 | /home/administrator/frappe-bench/apps/frappe/frappe/utils/error.py:
New Exception collected with id: 2017-10-12 21:32:18.091702-127.0.0.1-46e




Traceback (most recent call last):
  File "/home/administrator/frappe-bench/apps/frappe/frappe/app.py", line 57, in application
    response = frappe.handler.handle()
  File "/home/administrator/frappe-bench/apps/frappe/frappe/handler.py", line 22, in handle
    data = execute_cmd(cmd)
  File "/home/administrator/frappe-bench/apps/frappe/frappe/handler.py", line 53, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "/home/administrator/frappe-bench/apps/frappe/frappe/__init__.py", line 923, in call
    return fn(*args, **newargs)
  File "/home/administrator/frappe-bench/apps/frappe/frappe/client.py", line 60, in get_value
    frappe.throw(_("Not permitted"), frappe.PermissionError)
  File "/home/administrator/frappe-bench/apps/frappe/frappe/__init__.py", line 319, in throw
    msgprint(msg, raise_exception=exc, title=title, indicator='red')
  File "/home/administrator/frappe-bench/apps/frappe/frappe/__init__.py", line 309, in msgprint
    _raise_exception()
  File "/home/administrator/frappe-bench/apps/frappe/frappe/__init__.py", line 282, in _raise_exception
    raise raise_exception(encode(msg))
PermissionError: Not permitted



Traceback (most recent call last):
  File "/home/administrator/frappe-bench/env/local/lib/python2.7/site-packages/gunicorn/workers/sync.py", line 135, in handle
    self.handle_request(listener, req, client, addr)
  File "/home/administrator/frappe-bench/env/local/lib/python2.7/site-packages/gunicorn/workers/sync.py", line 176, in handle_request
    respiter = self.wsgi(environ, resp.start_response)
  File "/home/administrator/frappe-bench/env/local/lib/python2.7/site-packages/werkzeug/local.py", line 228, in application
    return ClosingIterator(app(environ, start_response), self.cleanup)
  File "/home/administrator/frappe-bench/env/local/lib/python2.7/site-packages/werkzeug/wrappers.py", line 301, in application
    return f(*args[:-2] + (request,))(*args[-2:])
  File "/home/administrator/frappe-bench/apps/frappe/frappe/app.py", line 90, in application
    frappe.db.rollback()
  File "/home/administrator/frappe-bench/apps/frappe/frappe/database.py", line 765, in rollback
    self.sql("rollback")
  File "/home/administrator/frappe-bench/apps/frappe/frappe/database.py", line 123, in sql
    self.connect()
  File "/home/administrator/frappe-bench/apps/frappe/frappe/database.py", line 69, in connect
    use_unicode=True, charset='utf8mb4')
  File "/home/administrator/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/__init__.py", line 86, in Connect
    return Connection(*args, **kwargs)
  File "/home/administrator/frappe-bench/env/local/lib/python2.7/site-packages/MySQLdb/connections.py", line 204, in __init__
    super(Connection, self).__init__(*args, **kwargs2)
OperationalError: (2002, 'Can\'t connect to local MySQL server through socket \'/var/run/mysqld/mysqld.sock\' (111 "Connection refused")')



Traceback (most recent call last):
  File "/home/administrator/frappe-bench/env/local/lib/python2.7/site-packages/gunicorn/workers/sync.py", line 135, in handle
    self.handle_request(listener, req, client, addr)
  File "/home/administrator/frappe-bench/env/local/lib/python2.7/site-packages/gunicorn/workers/sync.py", line 176, in handle_request
    respiter = self.wsgi(environ, resp.start_response)
  File "/home/administrator/frappe-bench/env/local/lib/python2.7/site-packages/werkzeug/local.py", line 228, in application
    return ClosingIterator(app(environ, start_response), self.cleanup)
  File "/home/administrator/frappe-bench/env/local/lib/python2.7/site-packages/werkzeug/wrappers.py", line 301, in application
    return f(*args[:-2] + (request,))(*args[-2:])
  File "/home/administrator/frappe-bench/apps/frappe/frappe/app.py", line 83, in application
    response = handle_exception(e)
  File "/home/administrator/frappe-bench/apps/frappe/frappe/app.py", line 134, in handle_exception
    response = frappe.utils.response.report_error(http_status_code)
  File "/home/administrator/frappe-bench/apps/frappe/frappe/utils/response.py", line 31, in report_error
    response = build_response("json")
  File "/home/administrator/frappe-bench/apps/frappe/frappe/utils/response.py", line 48, in build_response
    return response_type_map[frappe.response.get('type') or response_type]()
  File "/home/administrator/frappe-bench/apps/frappe/frappe/utils/response.py", line 74, in as_json
    response.data = json.dumps(frappe.local.response, default=json_handler, separators=(',',':'))
  File "/usr/lib/python2.7/json/__init__.py", line 250, in dumps
    sort_keys=sort_keys, **kw).encode(obj)
  File "/usr/lib/python2.7/json/encoder.py", line 207, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/usr/lib/python2.7/json/encoder.py", line 270, in iterencode
    return _iterencode(o, 0)
  File "/home/administrator/frappe-bench/apps/frappe/frappe/utils/response.py", line 122, in json_handler
    (type(obj), repr(obj)))
TypeError: Object of type <type '_sre.SRE_Match'> with value of <_sre.SRE_Match object at 0x7f48914b0e68> is not JSON serializable
[2017-10-12 20:20:29 +0000] [36974] [ERROR] Error handling request /

Can confirm that this exists in v9. Here is the workaround:

  1. Go to Role Permissions Manager
  2. Select Account Settings
  3. Click Add a New Rule
  4. Select Sales User under Role
  5. Click Add
  6. For Sales User, only select Read
  7. Do steps 1 - 6 for Purchase User

This patch Enhance Currency Exchange Management by tundebabzy · Pull Request #10482 · frappe/erpnext · GitHub assumed that all users had read rights to Account Settings which is not true.

Will PR this.

1 Like