golem/golem_member/views/res_partner_view.xml

139 lines
5.4 KiB
XML
Raw Normal View History

<?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/>.
-->
<openerp>
<data>
<!-- Forms -->
<record model="ir.ui.view" id="member_add">
<field name="name">Add information on linked member or member creation into main form</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form" />
<field name="arch" type="xml">
<h1 position="after">
<label for="member_id"
attrs="{'invisible': ['|', ('is_company', '=', True),
('member_id', '=', False)]}" />
<field name="member_id" widget="many2one" readonly="True"
attrs="{'invisible': ['|', ('is_company', '=', True),
('member_id', '=', False)]}" />
<button type="object" name="create_golem_member"
string="Create a GOLEM member from this contact"
attrs="{'invisible': ['|', ('is_company', '=', True),
('member_id', '!=', False)]}" />
</h1>
</field>
</record>
2016-09-08 10:55:20 +02:00
<!-- Kanban -->
<record model="ir.ui.view" id="member_kanban">
<field name="name">GOLEM Member Kanban view</field>
<field name="model">golem.member</field>
<field name="arch" type="xml">
<kanban>
<field name="color" />
<field name="display_name" />
<field name="title" />
<field name="email" />
<field name="phone" />
<field name="mobile" />
<field name="city" />
<field name="country_id" />
<field name="has_image" />
<field name="number" />
<field name="season_ids" />
<field name="category_id"/>
<templates>
<t t-name="kanban-box">
<div class="oe_kanban_vignette oe_semantic_html_override">
<a type="open">
<t t-if="record.has_image.raw_value === true">
<img t-att-src="kanban_image('res.partner', 'image_small', record.id.value)" class="oe_kanban_image"/>
</t>
<t t-if="record.has_image.raw_value === false">
<img t-att-src='_s + "/base/static/src/img/avatar.png"'
class="oe_kanban_image"/>
</t>
</a>
<div class="oe_kanban_details">
<h4 class="oe_partner_heading">
<a type="open"><field name="display_name" /></a>
(N° <field name="number" />)
</h4>
<div class="oe_kanban_partner_categories" />
<div class="oe_kanban_partner_links" />
<field name="season_ids" />
<ul>
<li t-if="record.city.raw_value and !record.country_id.raw_value">
<field name="city" />
</li>
<li t-if="!record.city.raw_value and record.country_id.raw_value">
<field name="country_id" />
</li>
<li t-if="record.city.raw_value and record.country_id.raw_value">
<field name="city" />, <field name="country_id" />
</li>
<li t-if="record.phone.raw_value or record.mobile.raw_value">
<a t-attf-href="tel:#{record.phone.raw_value}">
<field name="phone" />
</a>
<a t-attf-href="tel:#{record.mobile.raw_value}">
<field name="mobile" />
</a>
</li>
<li t-if="record.email.raw_value">
<a t-attf-href="mailto:#{record.email.raw_value}">
<field name="email" />
</a>
</li>
</ul>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<!-- Trees -->
<record model="ir.ui.view" id="member_tree">
<field name="name">Add member number to tree</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_tree" />
<field name="arch" type="xml">
<field name="display_name" position="before">
<field name="member_number" />
</field>
</field>
</record>
<!-- Searches -->
<record model="ir.ui.view" id="member_number_search">
<field name="name">Partner GOLEM Member Number search</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_res_partner_filter" />
<field name="arch" type="xml">
<field name="name" position="after">
<field name="member_number" />
</field>
</field>
</record>
</data>
</openerp>