Naming series update Not Permitted error

Respected All.,

When i am updating the naming series value it is giving error as Not permitted . Version 13.1.0

13.0.1 there is no error.Kindly do needfull. @nabinhait sir

Facing the same issue, do not know how to resolve it.
I want to start the series from 1 again after deleting all company transactions but its shows a popup saying “Not Permitted”

Any help would be greatly appreciated.

Logout from ERPNext,

Clear your browser history, cookies.

bench clear-cache
bench clear-website-cache
sudo supervisorctl restart all

Thanks for your suggestion, below is the result:

  1. Cleared browser history, cookies everything, closed browser.
  2. Fired all the three commands one by one
  3. Re-opened , logged in, and the issue is still the same.

I am posting the console output of the error below:

jquery.min.js:4 POST https://mywebsite/api/method/run_doc_method 403 (FORBIDDEN)
send @ jquery.min.js:4
ajax @ jquery.min.js:4
frappe.request.call @ request.js:229
frappe.call @ request.js:98
run_server_script @ button.js:36
onclick @ button.js:25
(anonymous) @ button.js:12
dispatch @ jquery.min.js:3
r.handle @ jquery.min.js:3
request.js:387 Traceback (most recent call last):
File “/home/pmnco/frappe-bench/apps/frappe/frappe/app.py”, line 68, in application
response = frappe.api.handle()
File “/home/pmnco/frappe-bench/apps/frappe/frappe/api.py”, line 54, in handle
return frappe.handler.handle()
File “/home/pmnco/frappe-bench/apps/frappe/frappe/handler.py”, line 31, in handle
data = execute_cmd(cmd)
File “/home/pmnco/frappe-bench/apps/frappe/frappe/handler.py”, line 67, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “/home/pmnco/frappe-bench/apps/frappe/frappe/init.py”, line 1175, in call
return fn(*args, **newargs)
File “/home/pmnco/frappe-bench/apps/frappe/frappe/handler.py”, line 228, in run_doc_method
is_whitelisted(fn)
File “/home/pmnco/frappe-bench/apps/frappe/frappe/init.py”, line 594, in is_whitelisted
throw(_(“Not permitted”), PermissionError)
File “/home/pmnco/frappe-bench/apps/frappe/frappe/init.py”, line 433, in throw
msgprint(msg, raise_exception=exc, title=title, indicator=‘red’, is_minimizable=is_minimizable, wide=wide, as_list=as_list)
File “/home/pmnco/frappe-bench/apps/frappe/frappe/init.py”, line 412, in msgprint
_raise_exception()
File “/home/pmnco/frappe-bench/apps/frappe/frappe/init.py”, line 366, in _raise_exception
raise raise_exception(msg)
frappe.exceptions.PermissionError: Not permitted

Please help!!

I have same problem after updating to v13.1.1. Earlier releases of v13 were not a problem. Also, I tried logging in as Administrator, and still a problem. Appears to be a bug with v13.1.1. Does it need to be reported in GitHub?

@Vivek_Champ @prateek.m @Suresh_Thakor

Solution with hot-fix below. GitHub issue opened.

Throw occurs here:

  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 585, in is_whitelisted
    throw(_("Not permitted"), PermissionError)

Code at 585 is this:

 	is_guest = session['user'] == 'Guest'
 	if method not in whitelisted or is_guest and method not in guest_methods:
 		throw(_("Not permitted"), PermissionError)

Updating a Naming Series start is not whitelisted!

Bug is at:
erpnext/setup/doctype/naming_series/naming_series.py
line: 162

def update_series_start(self):

To hot-fix, copy/paste a decorator from above so that:

@frappe.whitelist()
def update_series_start(self):

and then,

bench clear-cache
bench clear-website-cache

Works now for me.

2 Likes

@gdbaldw, Thanks for your effort.

1 Like

:sparkler: :100: :sparkler:

I did it and tried again, this time it showed success message but for some unknown reason its not resetting the series number, when creating a new voucher, the number is still the previous one instead of being reset to 1.

@prateek.m try to update directly in Database

Which table this field resides in?

After resetting, return to your ERPNext home page, reload the page. Only times I’ve had series not reset is if I mistakenly chose wrong series to reset, or failed to clear my web cache.

Double checked these things, still the same

Are you trying to set it to zero? I believe you can’t.

update tabSeries set current = 889 where name = ‘SINV-.YY.-’;

1 Like

Thanks it worked like a charm. I was searching table by tabname or tabnamingseries

Thanks a lot fellows for your help!!

Hello Vivek,

May I know how to update field “current” using server script?

There is no Doctype named “Series”

update tabSeries set current = 889 where name = ‘SINV-.YY.-’;