AttributeError: 'Meta' object has no attribute 'permissions'

When I create item variant I get the following error

Traceback (most recent call last):
  File "/opt/bench/frappe-bench/apps/frappe/frappe/", line 62, in application
    response = frappe.handler.handle()
  File "/opt/bench/frappe-bench/apps/frappe/frappe/", line 22, in handle
    data = execute_cmd(cmd)
  File "/opt/bench/frappe-bench/apps/frappe/frappe/", line 56, in execute_cmd
    return, **frappe.form_dict)
  File "/opt/bench/frappe-bench/apps/frappe/frappe/", line 1007, in call
    return fn(*args, **newargs)
  File "/opt/bench/frappe-bench/apps/frappe/frappe/", line 35, in get_list
    limit_start=limit_start, limit_page_length=limit_page_length, ignore_permissions=False)
  File "/opt/bench/frappe-bench/apps/frappe/frappe/", line 1235, in get_list
    return frappe.model.db_query.DatabaseQuery(doctype).execute(None, *args, **kwargs)
  File "/opt/bench/frappe-bench/apps/frappe/frappe/model/", line 87, in execute
    result = self.build_and_run()
  File "/opt/bench/frappe-bench/apps/frappe/frappe/model/", line 99, in build_and_run
    args = self.prepare_args()
  File "/opt/bench/frappe-bench/apps/frappe/frappe/model/", line 118, in prepare_args
  File "/opt/bench/frappe-bench/apps/frappe/frappe/model/", line 292, in build_conditions
    match_conditions = self.build_match_conditions()
  File "/opt/bench/frappe-bench/apps/frappe/frappe/model/", line 406, in build_match_conditions
    role_permissions = frappe.permissions.get_role_permissions(meta, user=self.user)
  File "/opt/bench/frappe-bench/apps/frappe/frappe/", line 164, in get_role_permissions
    applicable_permissions = list(filter(is_perm_applicable, doctype_meta.permissions))
AttributeError: 'Meta' object has no attribute 'permissions'

Barnchs develop and master have both this bug

I found the cause but don’t know how to solve it.
If I login as Aministrator, I don’t have this error but if I login using any other user I get Persmissions error. despite all the rolls including item manager are assigned to the created user.

1 Like

So you say the above ‘meta’ error has now gone away- since that perhaps points to a ‘meta’ permission code error.

IOW now you have simply a Permissions model violation to resolve?

1 Like

sorry I couldn’t understand your question,
still I have the problem of creating item variants in all other accounts except Administrator

No one can create item variant except Adminstrator

ok I see thanks for reporting AttributeError: 'Meta' object has no attribute 'permissions' · Issue #15130 · frappe/erpnext · GitHub