Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
4840 Lượt xem

We have a custom Activity Type "Request Comment" which is meant to ALWAYS be assigned to someone else.

Because Odoo defaults each Activity to the User creating it, some Users forget to assign it to the User they want commenting.

Can I force this specific Activity Type to require a User who IS NOT the User who is creating the Activity?

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

One option is to create a custom field that will remove the Assigned User if they are the same as the User creating the Activity, but ONLY for a specific Activity Type. 


This example assumes your custom Activity Type is named "RFC".

rfc_activity = self.env['mail.activity.type'].search([('name','=','RFC')])
for record in self:
if not rfc_activity:
record['x_clear_user'] = False
else:
if record.activity_type_id.id == rfc_activity[0].id and record.user_id.id == self.env.user.id:
record['user_id'] = False
record['x_clear_user'] = False


You then need to add this custom field to the UI, so create a Custom View like this that inherits the base mail.activity View and adds the field:


Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 3 21
3360
Activity vs Task Đã xử lý
2
thg 9 23
5553
1
thg 8 21
3605
0
thg 11 20
3378
0
thg 11 23
1565