mirror of
https://github.com/guohuadeng/app-odoo.git
synced 2025-02-23 04:11:36 +02:00
处理数据库,备份fix,端口改 5432
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
'name': "Database auto backup,数据库自动备份",
|
'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',
|
'summary': 'Automated backups, optimized from auto_backup of Yenthe Van Ginneken',
|
||||||
|
|
||||||
|
|||||||
@@ -27,9 +27,13 @@ class DbBackupDetails(models.Model):
|
|||||||
}
|
}
|
||||||
|
|
||||||
def unlink(self):
|
def unlink(self):
|
||||||
if self.file_path:
|
for rec in self:
|
||||||
if os.path.exists(self.file_path):
|
try:
|
||||||
os.remove(self.file_path)
|
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()
|
return super(DbBackupDetails, self).unlink()
|
||||||
|
|
||||||
def action_remove_file(self):
|
def action_remove_file(self):
|
||||||
|
|||||||
@@ -69,9 +69,9 @@ background-repeat: no-repeat;background-position: 10px center;color: #9F6000;bac
|
|||||||
<page name="backup_details" string="Backup records">
|
<page name="backup_details" string="Backup records">
|
||||||
<field name="backup_details_ids" readonly="1">
|
<field name="backup_details_ids" readonly="1">
|
||||||
<tree>
|
<tree>
|
||||||
<field name="name"/>
|
<field name="name" optional="hide"/>
|
||||||
<field name="file_path"/>
|
<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_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"/>
|
<button name="action_remove_file" type="object" title="Remove File" class="fa fa-trash"/>
|
||||||
</tree>
|
</tree>
|
||||||
|
|||||||
Reference in New Issue
Block a user