183 lines
8.3 KiB
XML
183 lines
8.3 KiB
XML
|
|
<?xml version="1.0" encoding="utf-8"?>
|
||
|
|
<odoo>
|
||
|
|
<!-- Subscription Template Tree View -->
|
||
|
|
<record id="subscription_template_view_tree" model="ir.ui.view">
|
||
|
|
<field name="name">subscription.template.view.tree</field>
|
||
|
|
<field name="model">subscription.template</field>
|
||
|
|
<field name="arch" type="xml">
|
||
|
|
<list>
|
||
|
|
<field name="sequence" widget="handle"/>
|
||
|
|
<field name="name"/>
|
||
|
|
<field name="product_id"/>
|
||
|
|
<field name="interval_number"/>
|
||
|
|
<field name="interval_type"/>
|
||
|
|
<field name="price_unit"/>
|
||
|
|
</list>
|
||
|
|
</field>
|
||
|
|
</record>
|
||
|
|
|
||
|
|
<!-- Subscription Template Form View -->
|
||
|
|
<record id="subscription_template_view_form" model="ir.ui.view">
|
||
|
|
<field name="name">subscription.template.view.form</field>
|
||
|
|
<field name="model">subscription.template</field>
|
||
|
|
<field name="arch" type="xml">
|
||
|
|
<form>
|
||
|
|
<sheet>
|
||
|
|
<div class="oe_button_box" name="button_box">
|
||
|
|
<button name="toggle_active" type="object" class="oe_stat_button" icon="fa-archive">
|
||
|
|
<field name="active" widget="boolean_button" options='{"terminology": "archive"}'/>
|
||
|
|
</button>
|
||
|
|
</div>
|
||
|
|
<div class="oe_title">
|
||
|
|
<label for="name"/>
|
||
|
|
<h1>
|
||
|
|
<field name="name" placeholder="Template Name"/>
|
||
|
|
</h1>
|
||
|
|
</div>
|
||
|
|
<group>
|
||
|
|
<group>
|
||
|
|
<field name="product_id"/>
|
||
|
|
<field name="quantity"/>
|
||
|
|
<field name="price_unit"/>
|
||
|
|
</group>
|
||
|
|
<group>
|
||
|
|
<field name="interval_number"/>
|
||
|
|
<field name="interval_type"/>
|
||
|
|
</group>
|
||
|
|
</group>
|
||
|
|
<group>
|
||
|
|
<field name="description"/>
|
||
|
|
</group>
|
||
|
|
</sheet>
|
||
|
|
</form>
|
||
|
|
</field>
|
||
|
|
</record>
|
||
|
|
|
||
|
|
<!-- Subscription Template Action -->
|
||
|
|
<record id="subscription_template_action" model="ir.actions.act_window">
|
||
|
|
<field name="name">Subscription Templates</field>
|
||
|
|
<field name="res_model">subscription.template</field>
|
||
|
|
<field name="view_mode">tree,form</field>
|
||
|
|
<field name="help" type="html">
|
||
|
|
<p class="o_view_nocontent_smiling_face">
|
||
|
|
Create your first subscription template
|
||
|
|
</p>
|
||
|
|
</field>
|
||
|
|
</record>
|
||
|
|
|
||
|
|
<!-- Subscription Tree View -->
|
||
|
|
<record id="subscription_view_tree" model="ir.ui.view">
|
||
|
|
<field name="name">subscription.subscription.view.tree</field>
|
||
|
|
<field name="model">subscription.subscription</field>
|
||
|
|
<field name="arch" type="xml">
|
||
|
|
<list decoration-success="state == 'active'" decoration-warning="state == 'draft'">
|
||
|
|
<field name="name"/>
|
||
|
|
<field name="partner_id"/>
|
||
|
|
<field name="template_id"/>
|
||
|
|
<field name="start_date"/>
|
||
|
|
<field name="next_invoice_date"/>
|
||
|
|
<field name="recurring_total" widget="monetary"/>
|
||
|
|
<field name="state" widget="badge" decoration-success="state == 'active'" decoration-warning="state == 'draft'"/>
|
||
|
|
</list>
|
||
|
|
</field>
|
||
|
|
</record>
|
||
|
|
|
||
|
|
<!-- Subscription Form View -->
|
||
|
|
<record id="subscription_view_form" model="ir.ui.view">
|
||
|
|
<field name="name">subscription.subscription.view.form</field>
|
||
|
|
<field name="model">subscription.subscription</field>
|
||
|
|
<field name="arch" type="xml">
|
||
|
|
<form>
|
||
|
|
<header>
|
||
|
|
<button name="action_start_subscription" string="Start Subscription" type="object" class="btn-primary" invisible="state != 'draft'"/>
|
||
|
|
<button name="action_close_subscription" string="Close" type="object" invisible="state != 'active'"/>
|
||
|
|
<button name="action_cancel_subscription" string="Cancel" type="object" invisible="state not in ('active', 'draft')"/>
|
||
|
|
<button name="action_draft_subscription" string="Set to Draft" type="object" invisible="state != 'cancelled'"/>
|
||
|
|
<field name="state" widget="statusbar" statusbar_visible="draft,active,closed"/>
|
||
|
|
</header>
|
||
|
|
<sheet>
|
||
|
|
<div class="oe_button_box" name="button_box">
|
||
|
|
<button name="action_view_invoices" type="object" class="oe_stat_button" icon="fa-usd">
|
||
|
|
<field name="invoice_count" widget="statinfo" string="Invoices"/>
|
||
|
|
</button>
|
||
|
|
</div>
|
||
|
|
<div class="oe_title">
|
||
|
|
<h1>
|
||
|
|
<field name="name" readonly="1"/>
|
||
|
|
</h1>
|
||
|
|
</div>
|
||
|
|
<group>
|
||
|
|
<group>
|
||
|
|
<field name="template_id" options="{'no_create': True}"/>
|
||
|
|
<field name="partner_id" options="{'no_create': True}"/>
|
||
|
|
<field name="company_id" groups="base.group_multi_company"/>
|
||
|
|
</group>
|
||
|
|
<group>
|
||
|
|
<field name="start_date"/>
|
||
|
|
<field name="next_invoice_date"/>
|
||
|
|
<field name="end_date"/>
|
||
|
|
<field name="last_invoice_date"/>
|
||
|
|
</group>
|
||
|
|
</group>
|
||
|
|
<group>
|
||
|
|
<group>
|
||
|
|
<field name="currency_id" invisible="1"/>
|
||
|
|
<field name="price_unit"/>
|
||
|
|
<field name="quantity"/>
|
||
|
|
<field name="recurring_total"/>
|
||
|
|
</group>
|
||
|
|
</group>
|
||
|
|
<group>
|
||
|
|
<field name="note" placeholder="Internal notes..."/>
|
||
|
|
</group>
|
||
|
|
</sheet>
|
||
|
|
</form>
|
||
|
|
</field>
|
||
|
|
</record>
|
||
|
|
|
||
|
|
<!-- Subscription Search View -->
|
||
|
|
<record id="subscription_view_search" model="ir.ui.view">
|
||
|
|
<field name="name">subscription.subscription.view.search</field>
|
||
|
|
<field name="model">subscription.subscription</field>
|
||
|
|
<field name="arch" type="xml">
|
||
|
|
<search>
|
||
|
|
<field name="name"/>
|
||
|
|
<field name="partner_id"/>
|
||
|
|
<field name="template_id"/>
|
||
|
|
<filter string="Active" name="active" domain="[('state', '=', 'active')]"/>
|
||
|
|
<filter string="Draft" name="draft" domain="[('state', '=', 'draft')]"/>
|
||
|
|
<filter string="Closed" name="closed" domain="[('state', '=', 'closed')]"/>
|
||
|
|
<group>
|
||
|
|
<filter string="Status" name="group_state" context="{'group_by': 'state'}"/>
|
||
|
|
<filter string="Customer" name="group_partner" context="{'group_by': 'partner_id'}"/>
|
||
|
|
<filter string="Template" name="group_template" context="{'group_by': 'template_id'}"/>
|
||
|
|
</group>
|
||
|
|
</search>
|
||
|
|
</field>
|
||
|
|
</record>
|
||
|
|
|
||
|
|
<!-- Subscription Action -->
|
||
|
|
<record id="subscription_action" model="ir.actions.act_window">
|
||
|
|
<field name="name">Subscriptions</field>
|
||
|
|
<field name="res_model">subscription.subscription</field>
|
||
|
|
<field name="view_mode">tree,form</field>
|
||
|
|
<field name="search_view_id" ref="subscription_view_search"/>
|
||
|
|
<field name="help" type="html">
|
||
|
|
<p class="o_view_nocontent_smiling_face">
|
||
|
|
Create your first subscription
|
||
|
|
</p>
|
||
|
|
<p>
|
||
|
|
Manage customer subscriptions and recurring billing.
|
||
|
|
</p>
|
||
|
|
</field>
|
||
|
|
</record>
|
||
|
|
|
||
|
|
<!-- Dashboard Action -->
|
||
|
|
<record id="subscription_dashboard_action" model="ir.actions.act_window">
|
||
|
|
<field name="name">Subscriptions Dashboard</field>
|
||
|
|
<field name="res_model">subscription.subscription</field>
|
||
|
|
<field name="view_mode">list,form</field>
|
||
|
|
<field name="domain">[('state', '=', 'active')]</field>
|
||
|
|
<field name="context">{'search_default_active': 1}</field>
|
||
|
|
</record>
|
||
|
|
</odoo>
|