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.
169 lines
8.4 KiB
169 lines
8.4 KiB
<?xml version="1.0" encoding="UTF-8" ?>
|
|
<odoo>
|
|
<!-- Action subscription contracts-->
|
|
<record id="subscription_contracts_action" model="ir.actions.act_window">
|
|
<field name="name">Contracts</field>
|
|
<field name="type">ir.actions.act_window</field>
|
|
<field name="res_model">subscription.contracts</field>
|
|
<field name="view_mode">tree,form</field>
|
|
<field name="help" type="html">
|
|
<p class="o_view_nocontent_smiling_face">
|
|
Create a new record!
|
|
</p>
|
|
</field>
|
|
</record>
|
|
<!-- Contracts menu-->
|
|
<menuitem id="subscription_contract_menu_action"
|
|
name="Contracts"
|
|
parent="sale.menu_sale_config"
|
|
action="subscription_contracts_action"/>
|
|
<!-- Subscription contract form view-->
|
|
<record id="subscription_contracts_view_form" model="ir.ui.view">
|
|
<field name="name">subscription.contracts.view.form</field>
|
|
<field name="model">subscription.contracts</field>
|
|
<field name="arch" type="xml">
|
|
<form>
|
|
<header>
|
|
<field name="state" widget='statusbar'
|
|
statusbar_visible='New,Ongoing,Expire Soon,Expired'/>
|
|
<button name="action_to_confirm" class="oe_highlight"
|
|
states="New" string="Confirm" type="object"
|
|
help="Confirm your Subscription Contracts"/>
|
|
<button name="action_generate_invoice"
|
|
class="oe_highlight"
|
|
states="Ongoing,Expire Soon,"
|
|
string="Generate Invoice"
|
|
type="object"
|
|
help="Generate Invoices for your Contracts"/>
|
|
<button name="action_lock" class="oe_highlight"
|
|
string="Lock" type="object"
|
|
help="Lock your Subscription Contracts"
|
|
attrs="{'invisible':['|',('lock', '=', True),('state','!=','Ongoing')]}"
|
|
/>
|
|
<button name="action_to_unlock" class="oe_highlight"
|
|
string="Unlock" type="object"
|
|
help="Unlock your Subscription Contracts"
|
|
attrs="{'invisible':['|',('lock', '=', False),('state','!=','Ongoing')]}"
|
|
/>
|
|
<button name="action_to_cancel" class="oe_highlight"
|
|
string="Cancel" type="object"
|
|
help="Cancel; your Subscription Contracts"
|
|
states="Ongoing,Expire Soon"
|
|
/>
|
|
</header>
|
|
<sheet>
|
|
<div class="oe_button_box" name="button_box" attrs="{'invisible':[('invoices_active','=',False)]}">
|
|
<button class="oe_stat_button" type="object"
|
|
name="action_get_invoice"
|
|
icon="fa-pencil-square-o"
|
|
states="Ongoing,Expire Soon,Expired"
|
|
>
|
|
<field string="Invoices"
|
|
name="invoice_count" widget="statinfo"
|
|
/>
|
|
</button>
|
|
</div>
|
|
<div class="oe_title">
|
|
<h1>
|
|
<field name="name" placeholder="Contracts"
|
|
attrs="{'readonly': [('lock', '=', True)]}"/>
|
|
</h1>
|
|
</div>
|
|
<group>
|
|
<group>
|
|
<field name="reference"
|
|
attrs="{'readonly': [('lock', '=', True)]}"/>
|
|
<field name="partner_id" options="{'no_create': True}"
|
|
attrs="{'readonly': [('lock', '=', True)]}"/>
|
|
<field name="recurring_period"
|
|
attrs="{'readonly': [('lock', '=', True)]}"/>
|
|
<field name="recurring_period_interval"
|
|
attrs="{'readonly': [('lock', '=', True)]}"/>
|
|
<field name="recurring_invoice"
|
|
attrs="{'readonly': [('lock', '=', True)]}"/>
|
|
<field name="next_invoice_date"
|
|
attrs="{'readonly': [('lock', '=', True)]}"/>
|
|
<field name="current_reference" invisible="1"/>
|
|
<field name="invoices_active" invisible="1"/>
|
|
</group>
|
|
<group>
|
|
<field name="contract_reminder"
|
|
attrs="{'readonly': [('lock', '=', True)]}"/>
|
|
<field name="company_id"
|
|
attrs="{'readonly': [('lock', '=', True)]}"/>
|
|
<field name="currency_id"
|
|
attrs="{'readonly': [('lock', '=', True)]}"/>
|
|
<field name="lock" invisible="1"/>
|
|
<field name="date_start"
|
|
attrs="{'readonly': [('lock', '=', True)]}"/>
|
|
<field name="date_end"
|
|
attrs="{'readonly': [('lock', '=', True)]}"/>
|
|
</group>
|
|
</group>
|
|
<notebook>
|
|
<page string="Contract Lines">
|
|
<field name="contract_line_ids"
|
|
attrs="{'readonly': [('lock', '=', True)]}"/>
|
|
<h2 class="oe_subtotal_footer oe_right">
|
|
<group>
|
|
<field name="amount_total"/>
|
|
</group>
|
|
</h2>
|
|
</page>
|
|
<page string="Sale Order Lines">
|
|
<field name="sale_order_line_ids"
|
|
attrs="{'readonly': [('lock', '=', True)]}"/>
|
|
</page>
|
|
<page string="Terms and Conditions">
|
|
<field name="note"
|
|
placeholder="Terms and Conditions"
|
|
attrs="{'readonly': [('lock', '=', True)]}"/>
|
|
</page>
|
|
</notebook>
|
|
</sheet>
|
|
<div class="oe_chatter">
|
|
<field name="message_follower_ids"/>
|
|
<field name="activity_ids"/>
|
|
<field name="message_ids"/>
|
|
</div>
|
|
</form>
|
|
</field>
|
|
</record>
|
|
<!-- Subscription contract tree view-->
|
|
<record id="subscription_contracts_view_tree" model="ir.ui.view">
|
|
<field name="name">subscription.contracts.view.tree</field>
|
|
<field name="model">subscription.contracts</field>
|
|
<field name="arch" type="xml">
|
|
<tree>
|
|
<field name="name"/>
|
|
<field name="partner_id"/>
|
|
<field name="next_invoice_date"/>
|
|
<field name="date_start"/>
|
|
<field name="date_end"/>
|
|
<field name="state" widget="badge"
|
|
decoration-success="state == 'Ongoing'"
|
|
decoration-warning="state =='Expire Soon'"
|
|
decoration-info="state =='New'"
|
|
decoration-danger="state in('Cancelled','Expired')"/>
|
|
<field name="amount_total"/>
|
|
</tree>
|
|
</field>
|
|
</record>
|
|
<!-- Contract line tree view-->
|
|
<record id="subscription_contracts_line_view_tree" model="ir.ui.view">
|
|
<field name="name">subscription.contracts.line.view.tree</field>
|
|
<field name="model">subscription.contracts.line</field>
|
|
<field name="arch" type="xml">
|
|
<tree editable="bottom">
|
|
<field name="product_id"/>
|
|
<field name="description"/>
|
|
<field name="qty_ordered"/>
|
|
<field name="product_uom_id"/>
|
|
<field name="price_unit"/>
|
|
<field name="tax_ids"/>
|
|
<field name="discount"/>
|
|
<field name="sub_total"/>
|
|
</tree>
|
|
</field>
|
|
</record>
|
|
</odoo>
|
|
|