Thank for the great contribution!!
We tried to use it, but we are getting error while saving the permission rule.
Screenshot is attached below
below is the complete error log
### App Versions
{
"erpnext": "14.6.0",
"frappe": "14.14.3",
"hrms": "1.0.0",
"payments": "0.0.1",
"permission": "1.0.0",
"real_estate_dubai": "0.0.1",
"whitelabel": "0.0.1"
}
### Route
Form/Permission Rule/new-permission-rule-1
### Trackeback
Traceback (most recent call last):
File "apps/frappe/frappe/app.py", line 69, 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 45, in handle
data = execute_cmd(cmd)
File "apps/frappe/frappe/handler.py", line 83, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File "apps/frappe/frappe/__init__.py", line 1585, in call
return fn(*args, **newargs)
File "apps/frappe/frappe/desk/form/save.py", line 23, in savedocs
doc.save()
File "apps/frappe/frappe/model/document.py", line 303, in save
return self._save(*args, **kwargs)
File "apps/frappe/frappe/model/document.py", line 325, in _save
return self.insert()
File "apps/frappe/frappe/model/document.py", line 257, in insert
self.run_before_save_methods()
File "apps/frappe/frappe/model/document.py", line 1038, in run_before_save_methods
self.run_method("validate")
File "apps/frappe/frappe/model/document.py", line 907, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File "apps/frappe/frappe/model/document.py", line 1256, in composer
return composed(self, method, *args, **kwargs)
File "apps/frappe/frappe/model/document.py", line 1238, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File "apps/frappe/frappe/model/document.py", line 904, in fn
return method_object(*args, **kwargs)
File "apps/permission/permission/permission/doctype/permission_rule/permission_rule.py", line 13, in validate
self.controle_disabled()
File "apps/permission/permission/permission/doctype/permission_rule/permission_rule.py", line 49, in controle_disabled
if self.disabled != old_doc.disabled:
AttributeError: 'NoneType' object has no attribute 'disabled'
### Request Data
{
"type": "POST",
"args": {
"doc": "{\"docstatus\":0,\"doctype\":\"Permission Rule\",\"name\":\"new-permission-rule-1\",\"__islocal\":1,\"__unsaved\":1,\"owner\":\"Administrator\",\"disabled\":0,\"doctypes\":[{\"docstatus\":0,\"doctype\":\"Permission Rule Doctypes\",\"name\":\"new-permission-rule-doctypes-1\",\"__islocal\":1,\"__unsaved\":1,\"owner\":\"Administrator\",\"share\":1,\"permission\":1,\"assign\":0,\"parent\":\"new-permission-rule-1\",\"parentfield\":\"doctypes\",\"parenttype\":\"Permission Rule\",\"idx\":1,\"doctype_name\":\"Unit\",\"field\":\"permission_detail\"}],\"users\":[{\"docstatus\":0,\"doctype\":\"Permission Rule Users\",\"name\":\"new-permission-rule-users-1\",\"__islocal\":1,\"__unsaved\":1,\"owner\":\"Administrator\",\"parent\":\"new-permission-rule-1\",\"parentfield\":\"users\",\"parenttype\":\"Permission Rule\",\"idx\":1,\"user_name\":\"Kittu Chechani\",\"user\":\"chechanimohit@gmail.com\"}],\"title\":\"Assign Units to Broker\"}",
"action": "Save"
},
"btn": {
"jQuery360087038004038523261": {
"events": {
"click": [
{
"type": "click",
"origType": "click",
"guid": 969,
"namespace": ""
}
]
}
}
},
"freeze": true,
"headers": {},
"error_handlers": {},
"url": "/api/method/frappe.desk.form.save.savedocs"
}
### Response Data
{
"exception": "AttributeError: 'NoneType' object has no attribute 'disabled'"
}