hello every body,
How can I do daily check if my date (Mymodel.field ) matches today date so schedule an activity
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
hello every body,
How can I do daily check if my date (Mymodel.field ) matches today date so schedule an activity
Hi,
You can create a scheduled action to execute the following Python code in your model.
check_date = fields.Date(string='Date')
def perform_daily_check(self):
today = date.today()
records = self.search([('check_date', '=', today)])
for record in records:
self.env['mail.activity'].create({
'res_id': record.id,
'res_model_id': self.env.ref('my_module.model_my_model').id,
'activity_type_id': self.env.ref('mail.mail_activity_data_todo').id,
'summary': 'Daily Check Activity',
'note': 'Perform daily check for record %s' % record.name,
})
How to create a scheduled action
Thanks
Thanks
@ Savya Sachin I search about same issue .... so when perform_daily_check this function will execute ?
yes, you should create a scheduled action to execute the above Python code on a daily basis
how add activity as future activity not today activity
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up
1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.