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
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
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:
In your form view, create a new field for the signature, and set its "related" attribute to "user_id.signature"
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.
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng kýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
How to display a report in a url?
Đã xử lý
|
|
1
thg 7 21
|
4671 | |
|
1
thg 10 24
|
1620 | ||
|
2
thg 10 24
|
2959 | ||
|
1
thg 9 24
|
4322 | ||
|
1
thg 7 24
|
2183 |