콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
2383 화면

Good morning, cordial greeting, I currently have a signature field which automatically adds the signature of the last user who modified the format, what I want is that I can add the user who is currently connected, your help, thanks 

아바타
취소
베스트 답변

In Odoo, you can use the "user_id" field in the "res.users" model to get the currently connected user. You can then use this field to update the signature field in your desired model.

Here's an example of how you can do this in a form view:

  1. In your form view, create a new field for the signature, and set its "related" attribute to "user_id.signature"

  2. In your form's "save" method, write a code to update the signature field with the current user's signature:

    def save(self):
    current_user = self.env.user
    self.signature = current_user.signature
    return super(YourModel, self).save()

This way when the form is saved the user's signature will be added to the signature field.


아바타
취소
관련 게시물 답글 화면 활동
1
7월 21
5025
1
10월 24
2013
2
10월 24
3340
1
9월 24
4721
1
7월 24
2618