处理数据库,备份fix,端口改 5432

This commit is contained in:
Ivan Office
2024-10-09 17:00:33 +08:00
parent ac527565ee
commit 8b2b329dc2
3 changed files with 10 additions and 6 deletions

View File

@@ -4,7 +4,7 @@
{
'name': "Database auto backup,数据库自动备份",
'version': '16.24.07.12',
'version': '16.24.10.09',
'summary': 'Automated backups, optimized from auto_backup of Yenthe Van Ginneken',

View File

@@ -27,9 +27,13 @@ class DbBackupDetails(models.Model):
}
def unlink(self):
if self.file_path:
if os.path.exists(self.file_path):
os.remove(self.file_path)
for rec in self:
try:
if rec.file_path:
if os.path.exists(rec.file_path):
os.remove(rec.file_path)
except Exception as e:
pass
return super(DbBackupDetails, self).unlink()
def action_remove_file(self):

View File

@@ -69,9 +69,9 @@ background-repeat: no-repeat;background-position: 10px center;color: #9F6000;bac
<page name="backup_details" string="Backup records">
<field name="backup_details_ids" readonly="1">
<tree>
<field name="name"/>
<field name="name" optional="hide"/>
<field name="file_path"/>
<field name="url" invisible="0"/>
<field name="url" optional="hide"/>
<button name="action_download_file" type="object" title="Download File" class="fa fa-download"/>
<button name="action_remove_file" type="object" title="Remove File" class="fa fa-trash"/>
</tree>