Skip to content

Commit

Permalink
[FIX] sql_export_mail : avoid trying to send mail for a not valid que…
Browse files Browse the repository at this point in the history
…ry. Odoo would raise an error anyway
  • Loading branch information
florian-dacosta committed Jun 17, 2024
1 parent e8df660 commit 5424711
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sql_export_mail/models/sql_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ def send_mail(self, params=None):

@api.model
def _run_all_sql_export_for_cron(self, cron_ids):
exports = self.search([("cron_ids", "in", cron_ids)])
exports = self.search(
[("cron_ids", "in", cron_ids), ("state", "=", "sql_valid")]
)
for export in exports:
if "%(company_id)s" in export.query and "%(user_id)s" not in export.query:
variable_dict = {}
Expand Down

0 comments on commit 5424711

Please sign in to comment.