Browse Source

Merge pull request #751 from eLBati/fix-auto_backup

[8.0] FIX auto_backup: avoid overwrinting of configuration at module update
pull/773/head
Moises Lopez - https://www.vauxoo.com/ 8 years ago
committed by GitHub
parent
commit
e131eb540b
  1. 5
      auto_backup/__openerp__.py
  2. 28
      auto_backup/data/backup_data.yml
  3. 20
      auto_backup/data/ir_cron.xml
  4. 21
      auto_backup/data/mail_message_subtype.xml

5
auto_backup/__openerp__.py

@ -7,7 +7,7 @@
{
"name": "Database Auto-Backup",
"summary": "Backups database",
"version": "8.0.1.0.1",
"version": "8.0.1.0.2",
"author": (
"VanRoey.be - Yenthe Van Ginneken, Agile Business Group,"
" Grupo ESOC Ingeniería de Servicios,"
@ -19,7 +19,8 @@
"depends": ['email_template'],
"demo": [],
"data": [
"data/backup_data.yml",
"data/ir_cron.xml",
"data/mail_message_subtype.xml",
"security/ir.model.access.csv",
"view/db_backup_view.xml",
],

28
auto_backup/data/backup_data.yml

@ -1,28 +0,0 @@
# -*- coding: utf-8 -*-
# © 2016 Grupo ESOC Ingeniería de Servicios, S.L.U. - Jairo Llopis
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
# Cron job
- !record {model: ir.cron, id: ir_cron_backupscheduler0}:
name: Backup scheduler
user_id: base.user_root
interval_number: 1
interval_type: days
numbercall: -1
nextcall: !eval
(datetime.now() + timedelta(days=1)).strftime("%Y-%m-%d 02:00:00")
model: db.backup
function: action_backup_all
# New message subtypes
- !record {model: mail.message.subtype, id: success}:
name: Backup successful
res_model: db.backup
default: False
description: Database backup succeeded.
- !record {model: mail.message.subtype, id: failure}:
name: Backup failed
res_model: db.backup
default: True
description: Database backup failed.

20
auto_backup/data/ir_cron.xml

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<data noupdate="1">
<record id="ir_cron_backup_scheduler_0" model="ir.cron">
<field name="name">Backup Scheduler</field>
<field name="user_id" ref="base.user_root" />
<field name="interval_number">1</field>
<field name="interval_type">days</field>
<field name="numbercall">-1</field>
<field name="nextcall"
eval="(datetime.now() + timedelta(days=1)).strftime('%Y-%m-%d 02:00:00')"
/>
<field name="model">db.backup</field>
<field name="function">action_backup_all</field>
</record>
</data>
</openerp>

21
auto_backup/data/mail_message_subtype.xml

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<openerp>
<data noupdate="1">
<record id="mail_message_subtype_success" model="mail.message.subtype">
<field name="name">Backup Successful</field>
<field name="description">Database backup succeeded.</field>
<field name="res_model">db.backup</field>
<field name="default" eval="False" />
</record>
<record id="mail_message_subtype_failure" model="mail.message.subtype">
<field name="name">Backup Failed</field>
<field name="description">Database backup failed.</field>
<field name="res_model">db.backup</field>
<field name="default" eval="True" />
</record>
</data>
</openerp>
Loading…
Cancel
Save