77 lines
3.9 KiB
XML
77 lines
3.9 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<openerp>
|
|
<data>
|
|
|
|
<!-- add visibility field to the employee form view -->
|
|
<record id="view_employee_form" model="ir.ui.view">
|
|
<field name="name">portal_hr_employees_form</field>
|
|
<field name="model">hr.employee</field>
|
|
<field name="inherit_id" ref="hr.view_employee_form"/>
|
|
<field name="arch" type="xml">
|
|
<xpath expr="//field[@name='user_id']" position="after">
|
|
<field name="visibility"/>
|
|
<field name="public_info" String="Public Notes" placeholder="Here you can write information about you to be shown in the portal..." attrs='{"invisible":[("visibility", "=", "private")]}'/>
|
|
</xpath>
|
|
</field>
|
|
</record>
|
|
|
|
<!-- a kanban view of the employees to the portal's contact page -->
|
|
<record id="portal_hr_employees_view" model="ir.ui.view">
|
|
<field name="name">portal_hr_employees_view</field>
|
|
<field name="model">portal_crm.crm_contact_us</field>
|
|
<field name="arch" type="xml">
|
|
<form string="Our Team" version="7.0">
|
|
<field name="employee_ids" widget="many2many_kanban">
|
|
<kanban>
|
|
<field name="visibility"/>
|
|
<templates>
|
|
<t t-name="kanban-box">
|
|
<div class="oe_employee_vignette">
|
|
<div class="oe_employee_image">
|
|
<img t-att-src="kanban_image('hr.employee', 'image_small', record.id.value)" class="oe_employee_picture"/>
|
|
</div>
|
|
<div class="oe_employee_details">
|
|
<h4>
|
|
<field name="name"/><t t-if="record.login.raw_value"> (<field name="login"/>)</t>
|
|
</h4>
|
|
<ul>
|
|
<li t-if="record.job_id.raw_value"><field name="job_id"/></li>
|
|
<li t-if="record.work_phone.raw_value">Tel: <field name="work_phone"/></li>
|
|
<li t-if="record.mobile_phone.raw_value">Mobile: <field name="mobile_phone"/></li>
|
|
<li t-if="record.work_email.raw_value"><a t-attf-href="mailto:#{record.work_email.value}"><field name="work_email"/></a></li>
|
|
<li t-if="record.public_info.raw_value"><field name="public_info"/></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</t>
|
|
</templates>
|
|
</kanban>
|
|
</field>
|
|
</form>
|
|
</field>
|
|
</record>
|
|
|
|
<record id="action_team" model="ir.actions.act_window">
|
|
<field name="name">Meet the team</field>
|
|
<field name="res_model">portal_crm.crm_contact_us</field>
|
|
<field name="view_id" ref="portal_hr_employees_view"/>
|
|
<field name="view_mode">form</field>
|
|
<field name="view_type">tree</field>
|
|
<field name="target">inline</field>
|
|
</record>
|
|
|
|
<record id="crm_contact_us" model="ir.ui.view">
|
|
<field name="name">crm_contact_us</field>
|
|
<field name="model">portal_crm.crm_contact_us</field>
|
|
<field name="inherit_id" ref="portal_crm.contact_form_view"/>
|
|
<field name="arch" type="xml">
|
|
<xpath expr="//div[@class='oe_portal_crm_team']" position="inside">
|
|
<a href="#action=portal_hr_employees.action_team">Meet the team</a>
|
|
</xpath>
|
|
</field>
|
|
</record>
|
|
|
|
|
|
</data>
|
|
</openerp>
|