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.
310 lines
15 KiB
310 lines
15 KiB
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
<!-- Subscription package action -->
|
|
<record id="subscription_package_action"
|
|
model="ir.actions.act_window">
|
|
<field name="name">Subscriptions</field>
|
|
<field name="type">ir.actions.act_window</field>
|
|
<field name="res_model">subscription.package</field>
|
|
<field name="view_mode">kanban,tree,form,pivot</field>
|
|
<field name="help" type="html">
|
|
<p class="o_view_nocontent_smiling_face">
|
|
Create a new subscription package !
|
|
</p>
|
|
</field>
|
|
</record>
|
|
<record id="res_partner_action"
|
|
model="ir.actions.act_window">
|
|
<field name="name">Subscriptions Customers</field>
|
|
<field name="type">ir.actions.act_window</field>
|
|
<field name="res_model">res.partner</field>
|
|
<field name="view_mode">kanban,tree,form</field>
|
|
<field name="domain">[('is_active_subscription', '=', True)]</field>
|
|
<field name="help" type="html">
|
|
<p class="o_view_nocontent_smiling_face">
|
|
Create a new subscription package !
|
|
</p>
|
|
</field>
|
|
</record>
|
|
<record id="subscription_package_to_renew_action"
|
|
model="ir.actions.act_window">
|
|
<field name="name">Subscriptions to Renew</field>
|
|
<field name="type">ir.actions.act_window</field>
|
|
<field name="res_model">subscription.package</field>
|
|
<field name="domain">[('is_to_renew', '=', True)]</field>
|
|
<field name="view_mode">kanban,tree,form,pivot</field>
|
|
<field name="help" type="html">
|
|
<p class="o_view_nocontent_smiling_face">
|
|
Create a new subscription package !
|
|
</p>
|
|
</field>
|
|
</record>
|
|
<!-- Subscription package tree view -->
|
|
<record id="subscription_package_view_tree" model="ir.ui.view">
|
|
<field name="name">subscription.package.view.tree</field>
|
|
<field name="model">subscription.package</field>
|
|
<field name="arch" type="xml">
|
|
<tree>
|
|
<field name="name"/>
|
|
<field name="stage_id"/>
|
|
<field name="partner_id"/>
|
|
<field name="reference_code"/>
|
|
<field name="start_date"/>
|
|
</tree>
|
|
</field>
|
|
</record>
|
|
<!-- Subscription package form view -->
|
|
<record id="subscription_package_view_form" model="ir.ui.view">
|
|
<field name="name">subscription.package.view.form</field>
|
|
<field name="model">subscription.package</field>
|
|
<field name="groups_id"
|
|
eval="[(4, ref('subscription_package.group_subscription_user'))]"/>
|
|
<field name="arch" type="xml">
|
|
<form>
|
|
<header>
|
|
<field name="current_stage" invisible="1"/>
|
|
<field name="is_closed" invisible="1"/>
|
|
<button name="button_start_date" string="START"
|
|
type="object" class="btn-primary"
|
|
invisible="stage_category != 'draft'"/>
|
|
<button name="button_resume" string="Resume"
|
|
type="object" class="btn-primary"
|
|
invisible="stage_category != 'paused'"/>
|
|
<button name="button_sale_order" string="Create Sale Order"
|
|
type="object" class="btn-primary"
|
|
invisible="stage_category != 'progress' or so_count > 0"/>
|
|
<button name="button_close" string="Close Subscription"
|
|
type="object" class="btn-secondary"
|
|
invisible="stage_category != 'progress'"/>
|
|
<field name="stage_id" widget="statusbar"
|
|
options="{'clickable' :0}"/>
|
|
</header>
|
|
<sheet>
|
|
<div class="oe_button_box" name="button_box">
|
|
<button name="button_sale_count" type="object"
|
|
class="oe_stat_button"
|
|
icon="fa-credit-card"
|
|
invisible="so_count == 0">
|
|
<div class="o_field_widget o_stat_info">
|
|
<span class="o_stat_value">
|
|
<field name="so_count"/>
|
|
</span>
|
|
<span class="o_stat_text">
|
|
Sale Order
|
|
</span>
|
|
</div>
|
|
</button>
|
|
<button name="button_invoice_count" type="object"
|
|
class="oe_stat_button"
|
|
icon="fa-book"
|
|
invisible="invoice_count <= 0">
|
|
<div class="o_field_widget o_stat_info">
|
|
<span class="o_stat_value">
|
|
<field name="invoice_count"/>
|
|
</span>
|
|
<span class="o_stat_text">
|
|
Invoices
|
|
</span>
|
|
</div>
|
|
</button>
|
|
</div>
|
|
<div>
|
|
<widget name="web_ribbon" title="To Renew"
|
|
bg_color="bg-info"
|
|
invisible="is_to_renew == False"/>
|
|
</div>
|
|
<div class="text-truncate w-100">
|
|
<h1>
|
|
<field name="name"
|
|
placeholder="e.g. Monthly Subscriptions"
|
|
readonly="1"/>
|
|
</h1>
|
|
</div>
|
|
<group>
|
|
<group>
|
|
<field name="partner_id" required="True"/>
|
|
<field name="partner_invoice_id"/>
|
|
<field name="partner_shipping_id"/>
|
|
<field name="date_started"/>
|
|
<field name="start_date"/>
|
|
<field name="next_invoice_date"/>
|
|
</group>
|
|
<group>
|
|
<field name="plan_id" required="True"
|
|
style="width:60%%"/>
|
|
<field name="is_to_renew" invisible="1"/>
|
|
<field name="reference_code"/>
|
|
<field name="recurrence_period_id"/>
|
|
<field name="analytic_account_id"/>
|
|
<field name="tag_ids" widget="many2many_tags"
|
|
options="{'limit': 2, 'create': false, 'create_edit': false}"/>
|
|
<field name="user_id"/>
|
|
<field name="company_id"/>
|
|
<field name="stage_category" invisible="1"/>
|
|
<field name="invoice_mode" invisible="1"/>
|
|
</group>
|
|
</group>
|
|
<notebook>
|
|
<page string="Subscriptions"
|
|
name="subscription_products_line">
|
|
<field name="product_line_ids">
|
|
<tree string="Product lines" editable="bottom">
|
|
<field name="sequence" widget="handle"/>
|
|
<field name="product_id" context="{'default_detailed_type': 'service'}"
|
|
required="1"/>
|
|
<field name="uom_catg_id" invisible="1"/>
|
|
<field name="product_qty" required="1"/>
|
|
<field name="product_uom_id" required="1"/>
|
|
<field name="currency_id" invisible="1"/>
|
|
<field name="unit_price" required="1"/>
|
|
<field name="discount" required="1"/>
|
|
<field name="tax_ids"
|
|
widget="many2many_tags"/>
|
|
<field name="price_tax" readonly="1"
|
|
/>
|
|
<field name="price_total" readonly="1"
|
|
/>
|
|
<field name="total_amount" readonly="1"/>
|
|
</tree>
|
|
</field>
|
|
|
|
<group name="note_group" col="6"
|
|
class="mt-2 mt-md-0">
|
|
<group class="oe_subtotal_footer oe_right"
|
|
colspan="2" name="recurring_total">
|
|
<field name="total_recurring_price"
|
|
widget="monetary"/>
|
|
<field name="tax_total" widget="monetary"/>
|
|
<field name="currency_id" invisible="1"/>
|
|
<field name="total_with_tax"
|
|
widget="monetary"/>
|
|
|
|
</group>
|
|
</group>
|
|
|
|
</page>
|
|
<page string="Terms and Conditions"
|
|
name="terms_and_conditions">
|
|
<field name="description"
|
|
placeholder="Terms and Conditions."/>
|
|
</page>
|
|
<page string="Other Info" name="other_info">
|
|
<group>
|
|
<group>
|
|
<field name="user_id"/>
|
|
<field name="sale_order_id"/>
|
|
</group>
|
|
<group>
|
|
</group>
|
|
</group>
|
|
</page>
|
|
</notebook>
|
|
</sheet>
|
|
<div class="oe_chatter">
|
|
<field name="message_follower_ids"
|
|
widget="mail_followers"/>
|
|
<field name="message_ids" widget="mail_thread"/>
|
|
<field name="activity_ids" widget="mail_activity"/>
|
|
</div>
|
|
</form>
|
|
</field>
|
|
</record>
|
|
<!-- Subscription package kanban view -->
|
|
<record id="subscription_package_view_kanban" model="ir.ui.view">
|
|
<field name="name">subscription.package.view.kanban</field>
|
|
<field name="model">subscription.package</field>
|
|
<field name="arch" type="xml">
|
|
<kanban default_group_by="stage_id" quick_create="false"
|
|
class="o_kanban_mobile" sample="1">
|
|
<field name="stage_id"/>
|
|
<field name="user_id"/>
|
|
<field name="is_to_renew"/>
|
|
<field name="partner_id"/>
|
|
<field name="reference_code"/>
|
|
<progressbar field='stage_id'
|
|
colors='{"progress_stage": "success", "draft_stage": "warning", "closed_stage": "muted"}'/>
|
|
<templates>
|
|
<t t-name="kanban-box">
|
|
<div class="oe_kanban_card oe_kanban_global_click">
|
|
<div class="oe_kanban_content">
|
|
<div class="o_kanban_record_title">
|
|
<field name="partner_id"/>
|
|
</div>
|
|
<div class="o_kanban_record_body">
|
|
<field name="reference_code"/>
|
|
<br/>
|
|
<div class="badge badge-pill badge-info badge-danger"
|
|
invisible="is_to_renew == False">
|
|
To Renew
|
|
</div>
|
|
</div>
|
|
<div class="o_kanban_record_bottom">
|
|
<div class="oe_kanban_bottom_left">
|
|
<field name="activity_ids"
|
|
widget="kanban_activity"/>
|
|
</div>
|
|
<div class="oe_kanban_bottom_right">
|
|
<field name="user_id"
|
|
widget="many2one_avatar_user"/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="oe_clear"/>
|
|
</div>
|
|
</t>
|
|
</templates>
|
|
</kanban>
|
|
</field>
|
|
</record>
|
|
<!-- Subscription package pivot view -->
|
|
<record id="subscription_package_view_pivot" model="ir.ui.view">
|
|
<field name="name">subscription.package.view.pivot</field>
|
|
<field name="model">subscription.package</field>
|
|
<field name="arch" type="xml">
|
|
<pivot string="Pivot View">
|
|
<field name="name" type="row"/>
|
|
</pivot>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="model_subscription_package_pause_record" model="ir.actions.server">
|
|
<field name="name">Pause Subscription</field>
|
|
<field name="model_id" ref="model_subscription_package"/>
|
|
<field name="binding_model_id" ref="model_subscription_package"/>
|
|
<field name="binding_view_types">form,list</field>
|
|
<field name="state">code</field>
|
|
<field name="code">
|
|
if records:
|
|
records.pause_subscription()
|
|
</field>
|
|
</record>
|
|
<!-- Subscription package menu items -->
|
|
<menuitem id="subscription_menu_root"
|
|
name="Subscription"
|
|
action="subscription_package.subscription_package_action"
|
|
sequence="1" groups="group_subscription_user"
|
|
web_icon="subscription_package,static/description/icon.png"/>
|
|
|
|
<menuitem id="subscription_menu_subscriptions"
|
|
name="Subscriptions"
|
|
parent="subscription_package.subscription_menu_root"
|
|
sequence="3"/>
|
|
|
|
<menuitem id="subscriptions_menu_subscriptions"
|
|
name="Subscriptions"
|
|
parent="subscription_package.subscription_menu_subscriptions"
|
|
action="subscription_package.subscription_package_action"
|
|
sequence="5"/>
|
|
<menuitem id="subscriptions_menu_subscriptions_to_renew"
|
|
name="Subscriptions to Renew"
|
|
parent="subscription_package.subscription_menu_subscriptions"
|
|
action="subscription_package.subscription_package_to_renew_action"
|
|
sequence="6"/>
|
|
|
|
<menuitem id="subscriptions_menu_subscriptions_customers"
|
|
name="Customers"
|
|
parent="subscription_package.subscription_menu_subscriptions"
|
|
action="subscription_package.res_partner_action"
|
|
sequence="7"/>
|
|
|
|
</odoo>
|
|
|