Hello and thank you for taking the time to review my post.
I would like to preface that I know a little about coding but not much, I am trying to configure my own Odoo for my small business.
I have to do maintenance on Equipment for my clients at set intervals (typically 3 month interval).
I would like to set Activity to remind myself to create the maintenance task. I do not wish to create the task automatically because those maintenance are often pushed to a later date by my customers.
With Studio, I added the following fields:
- Date field : to display the next planned maintenance date
- Integer field : to display the desired interval for maintenance (default 3)
I set the Model to "Maintenance Equipment" which is where I keep my Equipment data.
The action is set to execute every 1 day.
I tried to get a code from GPT to run Action and create an automatic Activity everyday and then increase the value of the Date field by the number of months in the Integer field.
The code saves but when I try to run it manually, I do not see any added Activities being generated. Could anyone help me fix this code please?
Thank you!
Ben
Code:
# Get today's date using Odoo's fields helper
Hello,
Try this:
to_process = model.search([
('x_studio_next_pm_date', '<=', today),
('x_studio_next_pm_date', '!=', False)
])
I read this updated code and still I did not get any activities generated. :(
Code:
# Get today's date using Odoo's fields helper