I want to receive a cron email with filtered customers meeting certain criteria in Odoo 13.
Specifically as an example, if I go to res.partner in a list view I will see all the customers in the database, then I can filter a field (say the state) and see all the records meeting the criteria. I want to send that filtered list in a regular basis by email.
My idea is to create a Template (everything through Odoo UI not Python coding), then set a scheduled job to send the email template in a regular basis.
My main challenge is to create the template in order to email the list view, a data export or whatever other option to receive that filtered info in a daily basis in my mailbox (regardless of the format, as text in the message body, as an attachment like PDF, CSV or XLS).
I am not a developer so I don't want to use Pycharm, etc but use Odoo UI and paste the code there.
So far I have been able to create a Qweb report with the filtered data but only works as long as I manually select (tick) all the records (ids) at the Res.partner tree view and after that click on "Print" and then select the report. It works the way I need it except for the need to manually have all the records ticked (active_ids). I believe t-foreach="docs" is only considering the active_ids and not all the database partners.
My question is: How can I have the report look at all the partners in the database without having to select them myself so that when I visit http://<serveraddress>/report/html/res_partner.report_imprerespartner the report is not blank?
The Qweb view that currently works (given the manual pre-selection of all the records) is:
<?xml version="1.0"?>
<t t-name="report_imprerespartner">
<t t-call="web.html_container">
<t t-call="web.external_layout">
<t t-foreach="docs" t-as="o">
<span t-if=“o.x_campo == 'pedido'">
<p>Notes: <span t-esc="o.comment" /></p>
</span>
</t>
</t>
</t>
</t>
QWEB Tips: http://learnopenerp.blogspot.com/search/label/Qweb