Yes, it is possible to dynamically show a list of products created today in a daily email, including details like the image, URL, name, etc. To achieve this, you can follow these general steps:
Create a scheduled action: Set up a scheduled action in Odoo to run daily and trigger the email generation process.
Define a method to fetch products: Write a method in your Odoo model to retrieve the products created today based on a date filter. You can use the fields.Datetime.now() function to get the current date and time. Here's an example:
from datetime import datetime, timedelta
class Product(models.Model):
_name = 'product.product'
def get_products_created_today(self):
today = datetime.now().date()
products = self.search([('create_date', '>=', str(today)), ('create_date', ' return products