Restricting user to specific income accounts while raising sales invoice

Hi All,

Below image shows my chart of accounts.<img

Now I want a particular user ‘gulbarga@selco-india.com’ to have access to only ‘Vat Sales Compact SHLS 5.5% - SEL’ income account.

So I set up the ‘User Permissions’ as mentioned below.

But when I raise an invoice I am getting the error as mentioned below…

But the user actually has permission to create sales invoice!!!

Can anyone help me if I am missing anything…

Thanks

Uncheck the Apply User Permissions option of Account User role through Role Permission Manager and try again, hope it will work fine .

wouldn’t that generally allow access to any account (what is not what @Basawaraj_Savalagi wants achieve if I understand the topic correctly) ?

Sales invoice also involves warehouse, COGS accounts if Update Stock is checked. Also cash/bank accounts if it’s POS transactions.

So pls make sure to allow these accounts for the user in User Permission Setting.

@jof2jc I have not checked ‘Update Stock’ Check box… I use a separate ‘Delivery Note’ to update stock… Also I am not using POS !!

Below is the error in my javascript console…
"
POST http://localhost:8000/ 403 (FORBIDDEN)k.cors.a.crossDomain.send @ jquery.min.js:4n.extend.ajax @ jquery.min.js:4frappe.request.call @ desk.min.js:7283frappe.call @ desk.min.js:7278_call @ form.min.js:204(anonymous function) @ form.min.js:195check_name @ form.min.js:198save @ form.min.js:195frappe.ui.form.save @ form.min.js:204(anonymous function) @ form.min.js:81j @ jquery.min.js:2k.add @ jquery.min.js:2_f.Frm._save @ form.min.js:79(anonymous function) @ form.min.js:72
desk.min.js:7294 Traceback (innermost last):
File “/home/kishor/frappe-bench/apps/frappe/frappe/desk/form/save.py”, line 18, in savedocs
doc.save()
File “/home/kishor/frappe-bench/apps/frappe/frappe/model/document.py”, line 231, in save
self.insert()
File “/home/kishor/frappe-bench/apps/frappe/frappe/model/document.py”, line 183, in insert
self.check_permission(“create”)
File “/home/kishor/frappe-bench/apps/frappe/frappe/model/document.py”, line 141, in check_permission
self.raise_no_permission_to(permlabel or permtype)
File “/home/kishor/frappe-bench/apps/frappe/frappe/model/document.py”, line 167, in raise_no_permission_to
raise frappe.PermissionError(msg)
PermissionError: No permission to create Sales Invoice

desk.min.js:7294 Traceback (innermost last):
File “/home/kishor/frappe-bench/apps/frappe/frappe/app.py”, line 57, in application
response = frappe.handler.handle()
File “/home/kishor/frappe-bench/apps/frappe/frappe/handler.py”, line 20, in handle
execute_cmd(cmd)
File “/home/kishor/frappe-bench/apps/frappe/frappe/handler.py”, line 37, in execute_cmd
ret = frappe.call(method, **frappe.form_dict)
File “/home/kishor/frappe-bench/apps/frappe/frappe/init.py”, line 805, in call
return fn(*args, **newargs)
File “/home/kishor/frappe-bench/apps/frappe/frappe/desk/form/save.py”, line 18, in savedocs
doc.save()
File “/home/kishor/frappe-bench/apps/frappe/frappe/model/document.py”, line 231, in save
self.insert()
File “/home/kishor/frappe-bench/apps/frappe/frappe/model/document.py”, line 183, in insert
self.check_permission(“create”)
File “/home/kishor/frappe-bench/apps/frappe/frappe/model/document.py”, line 141, in check_permission
self.raise_no_permission_to(permlabel or permtype)
File “/home/kishor/frappe-bench/apps/frappe/frappe/model/document.py”, line 167, in raise_no_permission_to
raise frappe.PermissionError(msg)
PermissionError: No permission to create Sales Invoice
"
(I dont think this message is helpful in anyway though)

Hi @umair is this a bug?

@rmehta @nabinhait any comments?

Under system setting, can you check whether you checked option : Ignore user permission if not defined?

@Basawaraj_Savalagi hard to say until we see the full user permissions.

Yes it was checked.

I unchecked it and tries to create invoice still same error.