flectra/addons/crm/views/res_partner_views.xml
2018-01-16 02:34:37 -08:00

121 lines
6.1 KiB
XML

<?xml version="1.0"?>
<flectra>
<!-- open meetings related to given partner -->
<record id="calendar_event_partner" model="ir.actions.act_window">
<field name="name">Meetings</field>
<field name="src_model">res.partner</field>
<field name="res_model">calendar.event</field>
<field name="view_mode">calendar,tree,form</field>
<field name="context">{'default_partner_ids': [active_id], 'search_default_partner_ids': [active_id]}</field>
</record>
<!-- open opportunities related to given partner -->
<record id="relate_partner_opportunities" model="ir.actions.act_window">
<field name="name">Opportunities</field>
<field name="res_model">crm.lead</field>
<field name="view_mode">kanban,tree,form,graph,calendar</field>
<field name="domain">[('type','=','opportunity')]</field>
<field name="context">{
'search_default_partner_id': active_id,
'default_type': 'opportunity'
}</field>
<field name="view_id" eval="False"/>
<field name="search_view_id" ref="crm.view_crm_case_opportunities_filter"/>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to create an opportunity related to this customer.
</p><p>
Use opportunities to keep track of your sales pipeline, follow
up potential sales and better forecast your future revenues.
</p><p>
You will be able to plan meetings and log activities from
opportunities, convert them into quotations, attach related
documents, track all discussions, and much more.
</p>
</field>
</record>
<record id="relate_partner_opportunities_kanban" model="ir.actions.act_window.view">
<field name="sequence" eval="0"/>
<field name="view_mode">kanban</field>
<field name="view_id" ref="crm_case_kanban_view_leads"/>
<field name="act_window_id" ref="relate_partner_opportunities"/>
</record>
<record id="relate_partner_opportunities_tree" model="ir.actions.act_window.view">
<field name="sequence" eval="1"/>
<field name="view_mode">tree</field>
<field name="view_id" ref="crm_case_tree_view_oppor"/>
<field name="act_window_id" ref="relate_partner_opportunities"/>
</record>
<record id="relate_partner_opportunities_form" model="ir.actions.act_window.view">
<field name="sequence" eval="2"/>
<field name="view_mode">form</field>
<field name="view_id" ref="crm_case_form_view_oppor"/>
<field name="act_window_id" ref="relate_partner_opportunities"/>
</record>
<!-- Partner kanban view inherte -->
<record id="crm_lead_partner_kanban_view" model="ir.ui.view">
<field name="name">res.partner.kanban.inherit</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.res_partner_kanban_view"/>
<field name="priority" eval="10"/>
<field name="groups_id" eval="[(4, ref('sales_team.group_sale_salesman'))]"/>
<field name="arch" type="xml">
<field name="mobile" position="after">
<field name="opportunity_count"/>
<field name="meeting_count"/>
</field>
<xpath expr="//div[hasclass('oe_kanban_partner_links')]" position="inside">
<span class="badge" t-if="record.opportunity_count.value>0"><i class="fa fa-fw fa-star"/><t t-esc="record.opportunity_count.value"/></span>
<span class="badge" t-if="record.meeting_count.value>0"><i class="fa fa-fw fa-calendar"/><t t-esc="record.meeting_count.value"/></span>
</xpath>
</field>
</record>
<!-- tree view of crm.activity.report -->
<record id="crm_activity_report_view_tree" model="ir.ui.view">
<field name="name">crm.activity.report.tree</field>
<field name="model">crm.activity.report</field>
<field name="arch" type="xml">
<tree delete="false" create="false">
<field name="author_id"/>
<field name="subtype_id"/>
<field name="subject"/>
<field name="date"/>
</tree>
</field>
</record>
<!-- Add contextual button on partner form view -->
<record id="view_partners_form_crm1" model="ir.ui.view">
<field name="name">view.res.partner.form.crm.inherited1</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field eval="18" name="priority"/>
<field name="groups_id" eval="[(4, ref('sales_team.group_sale_salesman'))]"/>
<field name="arch" type="xml">
<data>
<button name="toggle_active" position="before">
<button class="oe_stat_button o_res_partner_tip_opp" type="action"
attrs="{'invisible': [('customer', '=', False)]}"
name="%(crm.crm_lead_opportunities)d"
icon="fa-star"
context="{'search_default_partner_id': active_id}">
<field string="Opportunities" name="opportunity_count" widget="statinfo"/>
</button>
<button class="oe_stat_button" type="object"
name="schedule_meeting"
icon="fa-calendar"
context="{'partner_id': active_id, 'partner_name': name}">
<field string="Meetings" name="meeting_count" widget="statinfo"/>
</button>
</button>
</data>
</field>
</record>
</flectra>