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.

94 lines
3.6 KiB

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <record id="view_backup_conf_form" model="ir.ui.view">
  4. <field name="model">db.backup</field>
  5. <field name="arch" type="xml">
  6. <form>
  7. <header>
  8. <button name="action_backup" type="object" string="Execute backup" class="oe_highlight"/>
  9. </header>
  10. <div class="oe_title">
  11. <h1><field name="name"/></h1>
  12. </div>
  13. <group string="Basic backup configuration">
  14. <field name="folder"/>
  15. <field name="days_to_keep"/>
  16. <field name="method"/>
  17. </group>
  18. <div attrs="{'invisible': [('method', '!=', 'sftp')]}">
  19. <div class="bg-warning text-warning">
  20. <h3>Warning:</h3>
  21. Use SFTP with caution! This writes files to external servers under the path you specify.
  22. </div>
  23. <group string="SFTP Settings">
  24. <field name="sftp_host" placeholder="sftp.example.com"/>
  25. <field name="sftp_port"/>
  26. <field name="sftp_user" placeholder="john"/>
  27. <field name="sftp_password"/>
  28. <field
  29. name="sftp_private_key"
  30. placeholder="/home/odoo/.ssh/id_rsa"/>
  31. <button
  32. name="action_sftp_test_connection"
  33. type="object"
  34. string="Test SFTP Connection"
  35. icon="fa-television"/>
  36. </group>
  37. </div>
  38. <separator string="Help" colspan="2"/>
  39. <div>
  40. Automatic backups of the database can be scheduled as follows:
  41. <ol>
  42. <li>Go to Settings / Technical / Automation / Scheduled Actions.</li>
  43. <li>Search the action named 'Backup scheduler'.</li>
  44. <li>Set the scheduler to active and fill in how often you want backups generated.</li>
  45. </ol>
  46. </div>
  47. </form>
  48. </field>
  49. </record>
  50. <record id="view_backup_conf_tree" model="ir.ui.view">
  51. <field name="model">db.backup</field>
  52. <field name="arch" type="xml">
  53. <tree>
  54. <field name="name"/>
  55. <field name="folder"/>
  56. <field name="days_to_keep"/>
  57. </tree>
  58. </field>
  59. </record>
  60. <record id="view_backup_conf_search" model="ir.ui.view">
  61. <field name="model">db.backup</field>
  62. <field name="arch" type="xml">
  63. <search>
  64. <field name="name"/>
  65. <field name="folder"/>
  66. <field name="sftp_host"/>
  67. </search>
  68. </field>
  69. </record>
  70. <act_window
  71. name="Automated Backups"
  72. id="action_backup_conf_form"
  73. res_model="db.backup"/>
  74. <menuitem
  75. parent="base.next_id_9"
  76. action="action_backup_conf_form"
  77. id="backup_conf_menu"/>
  78. <!-- Execute backup from "More" menu -->
  79. <record id="action_server_backup" model="ir.actions.server">
  80. <field name="name">Execute backup(s)</field>
  81. <field name="type">ir.actions.server</field>
  82. <field name="model_id" ref="model_db_backup" />
  83. <field name="binding_model_id" ref="model_db_backup" />
  84. <field name="state">code</field>
  85. <field name="code">records.action_backup()</field>
  86. </record>
  87. </odoo>