golem/golem_member/views/golem_member_views.xml

263 lines
10 KiB
XML
Raw Normal View History

<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2017 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/>.
-->
2017-04-29 09:16:41 +02:00
<odoo>
<data>
<!-- Forms -->
<record id="golem_member_form" model="ir.ui.view">
<field name="name">GOLEM Member Form</field>
<field name="model">golem.member</field>
<field name="arch" type="xml">
<form>
<sheet>
<group>
<div class="oe_title">
<h1>
<field name="image" widget="image" class="oe_left oe_avatar"
options="{'preview_image': 'image_medium', 'size': [90, 90]}" />
<field name="name" class="oe_inline" readonly="True" />
</h1>
</div>
<div class="oe_right oe_button_box" name="buttons" />
<group>
<field name="season_ids" widget="many2many_tags" />
<field name="category_id" widget="many2many_tags"
placeholder="Tags..."/>
</group>
</group>
<group string="Personal details">
<group>
<field name="is_number_manual" invisible="True" />
<field name="lastname" required="True" />
<field name="firstname" required="True" />
<field name="number" readonly="True"
attrs="{'invisible': [('is_number_manual', '=', True)]}" />
<field name="number_manual"
attrs="{'invisible': [('is_number_manual', '=', False)]}" />
</group>
<group>
<field name="gender" />
<field name="birthdate_date" />
<field name="nationality_id" />
<field name="function" />
</group>
</group>
<notebook>
<page name="contact_details" string="Contact details">
<group string="Address">
<group>
<field name="street" placeholder="Street..." />
<field name="street2" />
<field name="zip" placeholder="ZIP" />
<field name="city" placeholder="City" />
</group>
<group>
<field name="state_id" class="oe_no_button"
placeholder="State" />
<field name="country_id" placeholder="Country"
class="oe_no_button" />
</group>
</group>
<group string="Communication">
<group>
<field name="phone" placeholder="0000000000"
widget="phonefr" />
<field name="mobile" placeholder="0000000000"
widget="phonefr" />
<field name="pictures_agreement"/>
</group>
<group>
<field name="email" widget="email"
placeholder="name@example.org" />
<label for="opt_out" string="Out of mailings?" />
<field name="opt_out" nolabel="1" />
2016-06-25 22:07:59 +02:00
<field name="opt_out_sms" />
<field name="website" widget="url"
placeholder="e.g. www.odoo.com"/>
</group>
</group>
</page>
<page name="other_page" string="Others">
<group>
<field name="comment" placeholder="Put an internal note..." />
</group>
</page>
</notebook>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers" />
<field name="message_ids" widget="mail_thread" />
</div>
</form>
</field>
</record>
<!-- Kanban -->
<record model="ir.ui.view" id="golem_member_kanban">
<field name="name">GOLEM Member Kanban view</field>
<field name="model">golem.member</field>
<field name="arch" type="xml">
<kanban>
<field name="image_small" />
<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="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.image_small.raw_value">
<img t-att-src="kanban_image('res.partner', 'image_small', record.id.value)" class="oe_kanban_image"/>
</t>
<t t-if="record.image_small.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="golem_member_tree">
<field name="name">GOLEM Member Tree/List</field>
<field name="model">golem.member</field>
<field name="arch" type="xml">
<tree string="GOLEM Members">
<field name="season_ids" options="{'no_create': True}" />
<field name="number" />
<field name="name" />
<field name="contact_address" />
<field name="phone" />
<field name="mobile" />
<field name="email" widget="email" />
</tree>
</field>
</record>
<!-- Searches -->
<record id="golem_member_search" model="ir.ui.view">
<field name="name">GOLEM Member Filters</field>
<field name="model">golem.member</field>
<field name="arch" type="xml">
<search>
<field name="number" />
<field name="name" />
<field name="season_ids" widget="many2one" />
<field name="contact_address" />
<field name="city" />
<field name="phone" />
<field name="mobile" />
<field name="email" />
<field name="category_id" widget="many2one" />
<filter name="season_default" string="Default season"
domain="[('is_current', '=', True)]" />
<group string="Group By">
2016-06-27 22:23:41 +02:00
<filter name="group_age" string="By age"
context="{'group_by': 'is_minor'}"/>
<filter name="group_gender" string="By gender"
context="{'group_by': 'gender'}"/>
<filter name="group_city" string="By city"
context="{'group_by': 'city'}"/>
</group>
</search>
</field>
</record>
<!-- Graphs -->
<record model="ir.ui.view" id="golem_member_graph">
<field name="name">GOLEM Member Graph</field>
<field name="model">golem.member</field>
<field name="arch" type="xml">
<graph string="GOLEM Members" type="pivot">
<field name="partner_id" />
</graph>
</field>
</record>
<!-- Actions -->
<act_window id="golem_member_action"
name="GOLEM Members"
res_model="golem.member"
view_mode="kanban,tree,form,graph"
context="{'search_default_season_default': True}" />
<act_window id="res_partner_category_action" name="GOLEM Members Tags"
res_model="res.partner.category" view_mode="tree,form" />
<!-- Menu items -->
<menuitem id="membership.menu_membership" name="Members" sequence="5"
parent="membership.menu_association" />
<menuitem id="golem_members_menu" name="GOLEM Members"
parent="membership.menu_membership" sequence="5"
action="golem_member_action" groups="golem_base.group_golem_user" />
<menuitem id="golem_members_menu_contacts" name="Contacts"
2016-07-21 16:45:54 +02:00
parent="membership.menu_membership" sequence="20"
action="contacts.action_contacts" groups="golem_base.group_golem_user" />
<menuitem id="res_partner_category_menu" name="Member Tags"
parent="membership.menu_marketing_config_association" sequence="10"
action="res_partner_category_action"
groups="golem_base.group_golem_manager" />
</data>
2017-04-29 09:16:41 +02:00
</odoo>