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

hello,

how can i add schedule activity belong to my custom model in depend on some domain

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

Hi 

You can inherit mail. activity in your custom model 

  _inherit = ["mail.activity.mixin"]

and add its button in the chatter of your form view

<div class="oe_chatter">

<field name="activity_ids" widget="mail_activity"/>
</div>

If we need to do it within the code, Try the follows

self.activity_schedule(
activity_type_id=activity_type_id or request.env['mail.activity.type'].search([('category', '=', 'reminder')], limit=1).id,
note=note.memo,
date_deadline=date_deadline
)

check the following References

https://youtu.be/wFiazv0bdVI?si=7JY2KLvyu3WhgHWR


Regards

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

thanks for your reply,

Send activity when the date field matches today's date , 

Ảnh đại diện
Huỷ bỏ