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.
 
 
 
 
 

172 lines
8.5 KiB

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Purchase Recurring Agreement tree View-->
<record id="purchase_recurring_agreement_view_tree" model="ir.ui.view">
<field name="name">purchase.recurring.agreement.view.tree</field>
<field name="model">purchase.recurring.agreement</field>
<field name="type">tree</field>
<field name="priority" eval="6"/>
<field name="arch" type="xml">
<tree string="Recurring Orders Agreements">
<field name="name"/>
<field name="partner_id"/>
<field name="start_date"/>
<field name="prolong"/>
<field name="next_expiration_date"/>
<field name="company_id" groups="base.group_multi_company"/>
</tree>
</field>
</record>
<!-- Purchase Recurring Agreement Form View-->
<record id="purchase_recurring_agreement_view_form"
model="ir.ui.view">
<field name="name">purchase.recurring.agreement.view.form</field>
<field name="model">purchase.recurring.agreement</field>
<field name="priority">6</field>
<field name="arch" type="xml">
<form>
<header>
<button name="action_generate_initial_order"
class="oe_highlight"
states="empty"
string="Generate Initial Order"
type="object"/>
<button name="action_generate_next_year_orders"
string="Generate Next Year Orders" type="object"
icon="fa-envelope"/>
<button name="%(agreement_renewal_action)d"
type="action"
string="Renew Agreement"
attrs="{'invisible': [('prolong','!=', 'recurrent')]}"/>
</header>
<sheet>
<div name="button_box" class="oe_button_box">
<button class="oe_stat_button" type="object"
name="action_view_purchase_order"
icon="fa-file"
attrs="{'invisible' : [('order_count','=',0)]}">
<field string="Orders" name="order_count"
widget="statinfo"/>
</button>
</div>
<div class="oe_title">
<h1>
<field name="name"/>
</h1>
</div>
<group>
<group>
<field name="partner_id"/>
<field name="company_id"
groups="base.group_multi_company"/>
<field name="prolong"
attrs="{'readonly':[('renewal_state','!=','not_renewed')]}"/>
<field name="last_renovation_date" readonly="1"
attrs="{'invisible': [('prolong','!=', 'recurrent')]}"/>
<field name="state" invisible="1"/>
<field name="renewal_state" invisible="1"/>
</group>
<group>
<field name="active" invisible="1"/>
<field name="name" invisible="1"/>
<field name="start_date"
attrs="{'readonly':[('state','!=','empty')]}"/>
<field name="next_expiration_date"/>
<field name="prolong_unit"
attrs="{'required': [('prolong', '!=', 'fixed')]}"/>
</group>
<group>
<group>
<group attrs="{'invisible': [('prolong','=', 'fixed')]}"
colspan="4" col="4">
<field name="prolong_interval"
attrs="{'required': [('prolong', '!=', 'fixed')]}"/>
</group>
<group attrs="{'invisible': [('prolong','!=', 'fixed')]}"
colspan="4" col="2">
<field name="end_date"
attrs="{'required': [('prolong', '=', 'fixed')]}"/>
</group>
</group>
</group>
</group>
<notebook colspan="4">
<page string="Lines">
<field name="agreement_line_ids">
<tree string="Agreement lines"
editable="bottom">
<field name="is_active" optional="hide"/>
<field name="product_id"/>
<field name="additional_description"/>
<field name="quantity"/>
<field name="uom_id"/>
<field name="list_price"/>
<field name="specific_price"/>
<field name="ordering_interval"/>
<field name="ordering_unit"/>
<field name="last_order_date"
readonly="True"/>
</tree>
</field>
</page>
<page string="Renewals"
attrs="{'invisible': [('prolong','!=', 'recurrent')]}">
<field colspan="4" mode="tree" name="renewal_ids"
widget="one2many_list" nolabel="1">
<tree string="Agreement Renewals">
<field name="date"/>
<field name="comments"/>
</tree>
</field>
</page>
</notebook>
<div class="oe_clear"/>
<field name="notes"/>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers"
groups="base.group_user"/>
<field name="message_ids" widget="mail_thread"
placeholder="Share a message..."/>
</div>
</form>
</field>
</record>
<!-- Purchase Recurring Agreement search View-->
<record id="purchases_recurring_agreement_view_search" model="ir.ui.view">
<field name="name">purchase.recurring.agreement.view.search</field>
<field name="model">purchase.recurring.agreement</field>
<field name="arch" type="xml">
<search>
<field name="name"
filter_domain="[('name', 'ilike', self)]"/>
<field name="partner_id"
filter_domain="[('partner_id', 'child_of', self)]"/>
</search>
</field>
</record>
<!-- Recurring Orders Agreement Menu Action-->
<record id="purchases_recurring_agreement_action"
model="ir.actions.act_window">
<field name="name">Recurring Order Agreement</field>
<field name="res_model">purchase.recurring.agreement</field>
<field name="view_mode">tree,form</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to set a new agreement.
</p>
<p>
Agreements are the way you define the commercial relation with
your customers which specify certain
products/services that you are providing them which requires a
recurring order.
</p>
</field>
</record>
<!-- Menu Recurring Order Agreement-->
<menuitem name="Recurring Order Agreement"
id="purchases_recurring_agreement_menu_agreement"
parent="purchase.menu_procurement_management"
action="purchases_recurring_agreement_action"
sequence="4"/>
</odoo>