Skip to content

Commit

Permalink
[MIG] auto_backup: Migration to 12.0
Browse files Browse the repository at this point in the history
  • Loading branch information
valentincastravete committed Mar 5, 2024
1 parent 07f7831 commit 6b6e89f
Show file tree
Hide file tree
Showing 6 changed files with 160 additions and 133 deletions.
8 changes: 2 additions & 6 deletions auto_backup/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,13 @@
"license": "AGPL-3",
"website": "https://github.com/OCA/server-tools",
"category": "Tools",
"depends": [
"mail",
],
"depends": ["mail"],
"data": [
"data/ir_cron.xml",
"data/mail_message_subtype.xml",
"security/ir.model.access.csv",
"view/db_backup_view.xml",
],
"installable": True,
"external_dependencies": {
"python": ["pysftp"],
},
"external_dependencies": {"python": ["pysftp"]},
}
11 changes: 6 additions & 5 deletions auto_backup/data/ir_cron.xml
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<odoo 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 03:00:00')"/>
<field name="model_id" ref="model_db_backup"/>
<field
name="nextcall"
eval="(datetime.now() + timedelta(days=1)).strftime('%Y-%m-%d 03:00:00')"
/>
<field name="model_id" ref="model_db_backup" />
<field name="state">code</field>
<field name="code">model.action_backup_all()</field>
</record>

</odoo>
5 changes: 1 addition & 4 deletions auto_backup/data/mail_message_subtype.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<odoo 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>

</odoo>
Loading

0 comments on commit 6b6e89f

Please sign in to comment.