- Introduced `saas.plan` model to define subscription plans with limits and pricing. - Created `saas.restaurant` model to manage restaurant tenants, including database provisioning and subscription management. - Implemented views for managing SaaS plans and restaurant tenants, including tree and form views. - Added security access rights for the new models. - Developed a backup management view for database backups. - Updated menu structure to include new SaaS management options. - Added Docker and deployment configurations for PostgreSQL, Redis, and Odoo services. - Included scaling guide and backup scripts for production environments. - Enhanced theme with new images and layout adjustments.
61 lines
2.4 KiB
XML
61 lines
2.4 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
<!-- Tree View -->
|
|
<record id="view_saas_backup_tree" model="ir.ui.view">
|
|
<field name="name">saas.backup.tree</field>
|
|
<field name="model">saas.backup</field>
|
|
<field name="arch" type="xml">
|
|
<tree string="SaaS Backups" create="false">
|
|
<field name="restaurant_id"/>
|
|
<field name="database_name"/>
|
|
<field name="backup_file"/>
|
|
<field name="timestamp"/>
|
|
<field name="storage_type"/>
|
|
<field name="status" widget="badge" decoration-success="status == 'success'" decoration-danger="status == 'failed'"/>
|
|
</tree>
|
|
</field>
|
|
</record>
|
|
|
|
<!-- Form View -->
|
|
<record id="view_saas_backup_form" model="ir.ui.view">
|
|
<field name="name">saas.backup.form</field>
|
|
<field name="model">saas.backup</field>
|
|
<field name="arch" type="xml">
|
|
<form string="Backup Record" edit="false" create="false">
|
|
<header>
|
|
<button name="action_backup_database" string="Run Backup Now" type="object" class="oe_highlight" invisible="status == 'success'"/>
|
|
<field name="status" widget="statusbar" statusbar_visible="failed,success"/>
|
|
</header>
|
|
<sheet>
|
|
<group>
|
|
<group string="Target Database">
|
|
<field name="restaurant_id"/>
|
|
<field name="database_name"/>
|
|
</group>
|
|
<group string="Execution Metadata">
|
|
<field name="timestamp"/>
|
|
<field name="storage_type"/>
|
|
<field name="backup_file"/>
|
|
<field name="s3_url" widget="url" invisible="not s3_url"/>
|
|
</group>
|
|
</group>
|
|
</sheet>
|
|
</form>
|
|
</field>
|
|
</record>
|
|
|
|
<!-- Action -->
|
|
<record id="action_saas_backup" model="ir.actions.act_window">
|
|
<field name="name">Database Backups</field>
|
|
<field name="res_model">saas.backup</field>
|
|
<field name="view_mode">tree,form</field>
|
|
</record>
|
|
|
|
<!-- Menuitem -->
|
|
<menuitem id="menu_saas_backup"
|
|
name="Database Backups"
|
|
parent="menu_saas_tenants"
|
|
action="action_saas_backup"
|
|
sequence="20"/>
|
|
</odoo>
|