You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

107 lines
4.0 KiB

[9.0][MIG] auto_backup (#526) * Update english pot file Added all the new fields and sentences. This will be the template for translations. * Dutch translations Full translation of the module to Dutch * Chinese translations Add Chinese translations to the module. Written by talway. * Changes chinese translation Changed some translations * Full German translations Thanks to Martin Schmid! * Typo fix could'nt > couldn't * Flemish translations Flemish translations are identical to Dutch. * Open FTP session on the last moment possible Used to open fp = open(file_path,'wb') a few lines before it was needed. This shouldn't be too much of a problem but opening and closing it right after eachother keeps the session open for less time and there are less chances on failure. * Porting module to OCA 8.0 * [FIX] module * [FIX] bug logger --> _logger call [FIX] Flake8 [RM] useless files * [FIX] Readme.rst * [FIX] defaults value * [FIX] rebased commit * [RM] description index.html * [RF] porting to new api [FIX] schedule_backup method [IMP] IT translation [IMP] tests * [FIX] test * [FIX] flake8 * [IMP] deps in travis.yml [FIX] flake8 * [FIX] flake8 and pylint * [FIX] name of file * [FIX] autoremove method [FIX] Contributors * [FIX] mail.tempale seems not work in cron task, replaced with direct call of mail.mail * [FIX] Readme * [FIX] review remarks * [FIX] handled ssl hosts [FIX] Flake8 * [FIX] handled ssl hosts [FIX] Flake8 * [FIX] fixed, last review remarks * [FIX] travis lint check * [FIX] backup only local db , beacause xmlrpc call of dump cause memory leak * [RM] useless field * [FIX] check_dd method [ADD] test case improved * [auto_backup] Refactor. - Follow template README. - Remove HTML README. - Move models to models folder. - Model and view file names follow guidelines. - Unused methods cleanup. - Remove unneeded `.pot` file. - Fix permissons. - Follow PEP8 in names everywhere. - Set more descriptive field names. - Disable backups for other databases, for security. - Remove db name from generated file, for easier cleanup. - EAFP logic everywhere. - More descriptive name. - Data files moved to YAML, with cleaner ir.cron record creation. - Add permissions for db.backup model. - Icons. - Update tests with new format. - Storage method is a selectable, for easier extensibility. - Instead of custom mailing, it just has a mail thread where you can subscribe. - Should fix almost all comments in https://github.com/OCA/server-tools/pull/203. * Update english pot file Added all the new fields and sentences. This will be the template for translations. * Dutch translations Full translation of the module to Dutch * Chinese translations Add Chinese translations to the module. Written by talway. * Changes chinese translation Changed some translations * Full German translations Thanks to Martin Schmid! * Typo fix could'nt > couldn't * Flemish translations Flemish translations are identical to Dutch. * Open FTP session on the last moment possible Used to open fp = open(file_path,'wb') a few lines before it was needed. This shouldn't be too much of a problem but opening and closing it right after eachother keeps the session open for less time and there are less chances on failure. * Porting module to OCA 8.0 * [FIX] module * [FIX] bug logger --> _logger call [FIX] Flake8 [RM] useless files * [FIX] Readme.rst * [FIX] defaults value * [FIX] rebased commit * [RM] description index.html * [RF] porting to new api [FIX] schedule_backup method [IMP] IT translation [IMP] tests * [FIX] test * [FIX] flake8 * [IMP] deps in travis.yml [FIX] flake8 * [FIX] flake8 and pylint * [FIX] name of file * [FIX] autoremove method [FIX] Contributors * [FIX] mail.tempale seems not work in cron task, replaced with direct call of mail.mail * [FIX] Readme * [FIX] review remarks * [FIX] handled ssl hosts [FIX] Flake8 * [FIX] handled ssl hosts [FIX] Flake8 * [FIX] fixed, last review remarks * [FIX] travis lint check * [FIX] backup only local db , beacause xmlrpc call of dump cause memory leak * [RM] useless field * [FIX] check_dd method [ADD] test case improved * [auto_backup] Refactor. - Follow template README. - Remove HTML README. - Move models to models folder. - Model and view file names follow guidelines. - Unused methods cleanup. - Remove unneeded `.pot` file. - Fix permissons. - Follow PEP8 in names everywhere. - Set more descriptive field names. - Disable backups for other databases, for security. - Remove db name from generated file, for easier cleanup. - EAFP logic everywhere. - More descriptive name. - Data files moved to YAML, with cleaner ir.cron record creation. - Add permissions for db.backup model. - Icons. - Update tests with new format. - Storage method is a selectable, for easier extensibility. - Instead of custom mailing, it just has a mail thread where you can subscribe. - Should fix almost all comments in https://github.com/OCA/server-tools/pull/203. * Reduce headers. This respects the upstream license choice (GPL/AGPL) but reduces verbosity. It would be ideal to have everything under AGPL though. * Fix view format. * Add shortcut to execute backups from the "More" menu. * Avoid duplicated backups. * Make sure you don't backup inside the filestore folder. The filestore is saved in the backup, so if you save the backup in the filestore, you'd end up with a huge backup that includes itself and the universe may collapse. * [FIX] This was removing all databases. * FIX License type * OCA Transbot updated translations from Transifex * OCA Transbot updated translations from Transifex * OCA Transbot updated translations from Transifex * [FIX] auto_backup: bad reference to field sftp_private_key (#423) Bump module version to 8.0.1.0.1 * [FIX] auto_backup: Empty dump using sftp backup option (#432) * [FIX] logger db_backup for pysftp (#419) * OCA Transbot updated translations from Transifex * OCA Transbot updated translations from Transifex * OCA Transbot updated translations from Transifex * OCA Transbot updated translations from Transifex * [FIX] remove en.po that was erroneously created by transbot * [MIG] auto_backup: Migrate to v9 * Add self.ensure_ones * Add test coverage * [ADD] auto_backup: Test coverage * compute_name * check_folder * action_sftp_test_connection * action_backup - sftp * action_backup_all * sftp_connection * filename
8 years ago
  1. <?xml version="1.0"?>
  2. <odoo>
  3. <record model="ir.ui.view" id="view_backup_conf_form">
  4. <field name="name">Automated Backups</field>
  5. <field name="model">db.backup</field>
  6. <field name="type">form</field>
  7. <field name="arch" type="xml">
  8. <form>
  9. <h1><field name="name"/></h1>
  10. <group string="Basic backup configuration">
  11. <field name="folder"/>
  12. <field name="days_to_keep"/>
  13. <field name="method"/>
  14. </group>
  15. <div attrs="{'invisible': [('method', '!=', 'sftp')]}">
  16. <div class="bg-warning text-warning">
  17. <h3>Warning:</h3>
  18. Use SFTP with caution! This writes files to external servers under the path you specify.
  19. </div>
  20. <group string="SFTP Settings">
  21. <field name="sftp_host" placeholder="sftp.example.com"/>
  22. <field name="sftp_port"/>
  23. <field name="sftp_user" placeholder="john"/>
  24. <field name="sftp_password"/>
  25. <field
  26. name="sftp_private_key"
  27. placeholder="/home/odoo/.ssh/id_rsa"/>
  28. <button
  29. name="action_sftp_test_connection"
  30. type="object"
  31. string="Test SFTP Connection"
  32. icon="gtk-network"/>
  33. </group>
  34. </div>
  35. <separator string="Help" colspan="2"/>
  36. <div>
  37. Automatic backups of the database can be scheduled as follows:
  38. <ol>
  39. <li>Go to Settings / Technical / Automation / Scheduled Actions.</li>
  40. <li>Search the action named 'Backup scheduler'.</li>
  41. <li>Set the scheduler to active and fill in how often you want backups generated.</li>
  42. </ol>
  43. </div>
  44. </form>
  45. </field>
  46. </record>
  47. <record model="ir.ui.view" id="view_backup_conf_tree">
  48. <field name="name">Automated Backups</field>
  49. <field name="model">db.backup</field>
  50. <field name="type">tree</field>
  51. <field name="arch" type="xml">
  52. <tree string="Backups">
  53. <field name='name'/>
  54. <field name='folder'/>
  55. <field name="sftp_host"/>
  56. </tree>
  57. </field>
  58. </record>
  59. <record model="ir.ui.view" id="view_backup_conf_search">
  60. <field name="name">Automated Backups</field>
  61. <field name="model">db.backup</field>
  62. <field name="type">search</field>
  63. <field name="arch" type="xml">
  64. <search string="Search options">
  65. <field name='name'/>
  66. <field name='folder'/>
  67. <field name="sftp_host"/>
  68. </search>
  69. </field>
  70. </record>
  71. <act_window
  72. name="Automated Backups"
  73. id="action_backup_conf_form"
  74. res_model="db.backup"/>
  75. <menuitem
  76. parent="base.menu_config"
  77. action="action_backup_conf_form"
  78. id="backup_conf_menu"/>
  79. <!-- Execute backup from "More" menu -->
  80. <record id="action_server_backup" model="ir.actions.server">
  81. <field name="name">Execute backup(s)</field>
  82. <field name="model_id" ref="model_db_backup"/>
  83. <field name="code">
  84. object.action_backup()
  85. </field>
  86. </record>
  87. <record model="ir.values" id="action_backup">
  88. <field name="name">Execute backup(s)</field>
  89. <field name="action_id" ref="action_server_backup" />
  90. <field
  91. name="value"
  92. eval="'ir.actions.server,%d' % ref('action_server_backup')" />
  93. <field name="key">action</field>
  94. <field name="model_id" ref="model_db_backup" />
  95. <field name="model">db.backup</field>
  96. <field name="key2">client_action_multi</field>
  97. </record>
  98. </odoo>