Skip to content

Commit

Permalink
[IMP] sql_export : Add last_run datetime field
Browse files Browse the repository at this point in the history
This may be quite usefull to detect osbolete queries not used anymore in order to remove it
  • Loading branch information
florian-dacosta committed May 16, 2024
1 parent e8df660 commit dd7cfc7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions sql_export/models/sql_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class SqlExport(models.Model):

use_properties = fields.Boolean(compute="_compute_use_properties")
query_properties_definition = fields.PropertiesDefinition("Query Properties")
last_run = fields.Datetime()

encoding = fields.Selection(
[
Expand Down
1 change: 1 addition & 0 deletions sql_export/views/sql_export_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
<field name="mode">primary</field>
<field name="arch" type="xml">
<field name="state" position="after">
<field name="last_run" />
<button
name="export_sql_query"
string="Execute Query"
Expand Down
1 change: 1 addition & 0 deletions sql_export/wizard/wizard_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ def export_sql(self):
% {"name": sql_export.name, "date": date, "extension": extension},
}
)
sql_export.write({"last_run": fields.Datetime.now()})
action = {
"name": "SQL Export",
"type": "ir.actions.act_url",
Expand Down

0 comments on commit dd7cfc7

Please sign in to comment.