yaltik_odoo_custom/yaltik_crm_action/views/crm_lead_views.xml

136 lines
5.5 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2016 Fabien Bourgeois <fabien@yaltik.com>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
-->
<odoo>
<data>
<!-- Actions -->
<act_window id="crm_action_simple_action" name="Actions"
res_model="crm.action" view_mode="tree,form,calendar" />
<!-- Form -->
<!-- Lead and opp only : next action creation... -->
<record model="ir.ui.view" id="crm_case_form_view_leads_inherit_crm_action">
<field name="name">CRM Lead Form adaptations</field>
<field name="model">crm.lead</field>
<field name="inherit_id" ref="crm.crm_case_form_view_leads" />
<field name="arch" type="xml">
<!-- Actions in button box -->
<div class="oe_button_box" position="inside">
<button class="oe_inline oe_stat_button" type="action" icon="fa-list"
name="%(crm_action_simple_action)d"
context="{'search_default_lead_id': active_id, 'search_default_user_me': 0}">
<field string="Actions" name="action_count" widget="statinfo" />
</button>
</div>
<!-- Next action -->
<label for="contact_name" position="before">
<label for="next_action_id" />
<div class="oe_row">
<field name="next_action_id"
attrs="{'invisible': [('next_action_id', '=', False)]}" />
<button name="next_action_done" type="object"
icon="fa-check" class="oe_inline" help="Mark next action as done"
attrs="{'invisible': [('next_action_id', '=', False)]}"/>
</div>
</label>
</field>
</record>
<record model="ir.ui.view" id="crm_case_form_view_oppor_inherit_crm_action">
<field name="name">Opportunity form adaptations</field>
<field name="model">crm.lead</field>
<field name="inherit_id" ref="crm.crm_case_form_view_oppor" />
<field name="arch" type="xml">
<!-- Actions in button box -->
<div class="oe_button_box" position="inside">
<button class="oe_inline oe_stat_button" icon="fa-list" type="action"
name="%(crm_action_simple_action)d"
context="{'search_default_lead_id': active_id, 'search_default_user_me': 0}">
<field string="Actions" name="action_count" widget="statinfo" />
</button>
</div>
<!-- Replace group of native activities -->
<xpath expr="//sheet/group[1]/group[2]" position="replace">
<group>
<label for="next_action_id" />
<div class="oe_row">
<field name="next_action_id"
attrs="{'invisible': [('next_action_id', '=', False)]}" />
<button name="next_action_done" type="object" class="oe_inline"
help="Mark next action as done" icon="fa-check"
attrs="{'invisible': [('next_action_id', '=', False)]}" />
</div>
</group>
</xpath>
<!-- Hide activity logging -->
<button name="%(crm.crm_activity_log_action)d" position="attributes">
<attribute name="invisible">True</attribute>
</button>
</field>
</record>
<!-- Kanbans -->
<record id="crm_case_kanban_view_leads_inherit_crm_action" model="ir.ui.view">
<field name="name">CRM Lead Kanban adaptations</field>
<field name="model">crm.lead</field>
<field name="inherit_id" ref="crm.crm_case_kanban_view_leads" />
<field name="arch" type="xml">
<xpath expr="//a[@name='%(crm.crm_activity_log_action)d']"
position="attributes">
<attribute name="name">%(crm_action_simple_action)d"</attribute>
</xpath>
<xpath expr="//a[@name='%(crm.crm_activity_schedule_action)d']"
position="attributes">
<attribute name="name">%(crm_action_simple_action)d"</attribute>
</xpath>
</field>
</record>
<!-- Trees -->
<record id="crm_case_form_view_lead_inherit_crm_action" model="ir.ui.view" >
<field name="name">CRM Lead Tree Activity adaptations</field>
<field name="model">crm.lead</field>
<field name="inherit_id" ref="crm.crm_lead_view_tree_activity" />
<field name="arch" type="xml">
<field name="next_activity_id" position="replace">
<field name="next_action_id" />
</field>
</field>
</record>
<!-- Searches -->
<record id="crm_case_opp_search_inherit_cmr_action" model="ir.ui.view" >
<field name="name">CRM Opportunity Search adaptations</field>
<field name="model">crm.lead</field>
<field name="inherit_id" ref="crm.view_crm_case_opportunities_filter" />
<field name="arch" type="xml">
<field name="next_activity_id" position="replace">
<field name="next_action_id" />
</field>
<filter name="today" position="replace"></filter>
<filter name="this_week" position="replace"></filter>
<filter name="overdue" position="replace"></filter>
</field>
</record>
</data>
</odoo>