Hello, folks! I’m asking my self if I can use alternative docstatus numbers, to control the fields that the user can access based on a workflow!
I know that docstatus have 3 restricted numbers 0, 1 and 2, I’m asking if I use any alternative number like 3, 4, 200, and put this status in the User Permissions, it only will allow the user to see/edit certain fields when the docstatus reach a condition?
rmehta
April 1, 2016, 7:09am
2
@max_morais_dmm maybe have a separate status for permissions? This will involve large scale code change.
@max_morais_dmm To do quick fix, you can use permission query.
base_template = "templates/base.html"
write_file_keys = ["file_url", "file_name"]
notification_config = "frappe.core.notifications.get_notification_config"
before_tests = "frappe.utils.install.before_tests"
email_append_to = ["Event", "ToDo", "Communication"]
calendars = ["Event"]
leaderboards = "frappe.desk.leaderboard.get_leaderboards"
# login
on_session_creation = [
"frappe.core.doctype.activity_log.feed.login_feed",
"frappe.core.doctype.user.user.notify_admin_access_to_system_manager",
]
"reference_name": self.reference_name,
"status": ("!=", "Cancelled"),
"allocated_to": ("is", "set"),
},
pluck="allocated_to",
)
assignments.reverse()
frappe.db.set_value(
self.reference_type,
self.reference_name,
"_assign",
json.dumps(assignments),
update_modified=False,
)
except Exception as e:
if frappe.db.is_table_missing(e) and frappe.flags.in_install:
# no table
return
So, user can see only permitted document for assigned role.
1 Like
@kolate_sambhaji I was exactly what I was looking for! Thanks!
1 Like