i need to add function to insurance_expire_date field if this field is less by 5 days than the current date then send massage to hr manager group how i can do that and what the syntax please i need a quick help.
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ờ
2
Trả lời
4647
Lượt xem
Hi,
You can create onchange method for expire_date field. For e.g. In your xml file:
<field name="expire_date" on_change="onchange_expire_date(expire_date)"/>
In your py file add the function below:
def onchange_expire_date((self, cr, uid, ids, expire_date, context=None):
datetime_today = datetime.now()
if (datetime_today - expire_date).days <= 5:
# Send message
else:
# else part
Hope this may help you.
Create an Automated Action which calls the Server Action 5 days before a insurance_exp ire_date and send Email to hr manager group using Email Template
Refer the below link:-
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ý