Display userdata in documents

Hello together.

Im new to this software and have some problems that i dont find in the documentation (yet?)

I want to display the curretly logged in user in a print doc. I found out how to get the doc owner but not the current logged in user that edits the form.

The idea is to display the user that edits the form automatically, as he will be the owne responsible for further tasks and hes mentioned in the print.

I searched around now but the owner is all i found.

Thank you and hello to the community.

Welcome to community.

By using frappe.session.user you can get current logged in user and you can get doc modifier from modified_by field.

<!-- TO print current logged in user email id -->
<div class="row">
    <div class="col-xs-5 text-right"><big><b>Print By(email id)</b>  </big></div>
    <div class="col-xs-7 "><big>{{ frappe.user }} </big> </div>
</div> 

<!-- TO print current logged in user fist name -->
{% set u = frappe.get_doc("User", frappe.user) %} 
<div class="row">
    <div class="col-xs-5 text-right"><big><b>Print By(user name)</b>  </big></div>
    <div class="col-xs-7 "><big>{{ u.first_name }} </big> </div>
</div>    

Thanks,
Sambhaji

3 Likes

Nice! Thanks a lot :smile:

@saurabh6790 i came too late to try your approach, i just implemented the other way. But thank you too for input,

1 Like