mirror of
https://github.com/OCA/reporting-engine.git
synced 2025-02-16 16:30:38 +02:00
[IMP] sql_export : Add last_run datetime field
This may be quite usefull to detect osbolete queries not used anymore in order to remove it
This commit is contained in:
@@ -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(
|
||||
[
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -63,6 +63,7 @@ class SqlFileWizard(models.TransientModel):
|
||||
% {"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",
|
||||
|
||||
Reference in New Issue
Block a user