If you haven’t checked then check it.
https://docs.erpnext.com/docs/v13/user/manual/en/setting-up/users-and-permissions/adding-users#271-module-profiles
Thank You!
Hey thanks for the reply .
But i got stuck in the block modules
when i get values for the block modues from the api. it blocks those module[it unchecked those modules] but i want to check those modules particularly, but by default all the module is checked…how can i uncheck other modules and check the specific module from the api.?
[ the passing block module is getting unchecked but i want them to be checked specifically and the other modules to be uncheked ]
@frappe.whitelist( allow_guest = True )
def insert_user(first_name,email):
user = frappe.get_doc({
"doctype":"User",
"first_name":first_name,
"email":email,
"new_password":"Frappe@123",
"roles": [{"role": "System Manager"},{"role": "Blogger"},{"role": "Loan Manager"}],
"block_modules":[{"module":"Contacts"},{"module":"Core"},{"module":"Email"},{"module": "Desk"},{"module": "Accounts"}]
})
user.insert(ignore_permissions=True)
frappe.db.commit()
return f"The data for {first_name} inserted"
somehow i find the solution by deleting the modules in the block modules for the respective user to mark the module checked for that user[ in the above relpy i pass all the block module’s module to make all of them unchecked ]
@frappe.whitelist(allow_guest = True)
def allow_mod(email,modules):
em=email
m_filter = modules.split(',')
for i in range(1):
for j in m_filter:
frappe.db.sql(f"""delete from `tabBlock Module` where module = "{j}" and parent = "{em}";""")
frappe.db.commit()
return f"module for {email} is added"