Files
odoo_source/addons/hr/data/hr_data.xml
T
Yannick Tivisse 47728ccd40 [FIX] hr, hr_expense: Allow employees to send emails to aliases
New feature in mail module
==========================

Currently, an email can be sent to an alias from:
- Everyone
- Authenticated Partners
- Followers

This commit is intended to add another category: Employees
The main purpose of this new feature is to allow employees to send an email
to an 'expense' alias in order to create automatically their expenses with
their mobile phones.

Use this new mechanism in hr_expense
====================================

Currenlty, we're overriding message_new to make a security check and create
an expense if the sender is an employee or bounce otherwise, which is not the
correct way to achieve this. A better way is to use the alias mechanism now
that it has been extended to employees too.

Don't hardcode email_from
=========================

The email_from of the bounce email is hardcoded to "help@odoo.com". I am sure
they will be happy to receive all answers from any odoo instance

Review the bounce email content
===============================

content: Your expense has not been created because your email address is not set
on an employee or on a employee's user. Configure your employee's information correctly and try again.
-> this is a message for the admin, not an employee or anyone else

Now the content is generical for aliase defined for employees.
2016-08-25 14:55:08 +02:00

45 lines
2.6 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<!-- notify all employees of module installation -->
<record id="module_install_notification" model="mail.message">
<field name="model">mail.channel</field>
<field name="res_id" ref="mail.channel_all_employees"/>
<field name="message_type">notification</field>
<field name="subtype_id" ref="mail.mt_comment"/>
<field name="subject">Employee Directory application installed!</field>
<field name="body"><![CDATA[<p>Manage your human resources with Odoo: employees and their hierarchy, HR departments and job positions.</p>
<p>More HR features are available via extra applications: Recruitment Process (manage job positions and recruitment), Timesheet Validation (record timesheets and attendance),
Leave Management (keep track of employee leaves), Expense Management (manage employee expenses), Employee Appraisals (organize employee surveys, where employees evaluate their subordinates or their manager).</p>]]></field>
</record>
<record id="dep_administration" model="hr.department">
<field name="name">Administration</field>
</record>
<record id="dep_sales" model="hr.department">
<field name="name">Sales</field>
</record>
<record id="employee_root" model="hr.employee">
<field name="name" eval="obj(ref('base.partner_root')).name" model="res.partner"/>
<field name="user_id" ref="base.user_root"/>
<field name="address_id" ref="base.partner_root"/>
<field name="address_home_id" ref="base.partner_root"/>
<field name="image" eval="obj(ref('base.partner_root')).image" model="res.partner"/>
</record>
<record id="mail_template_data_unknown_employee_email_address" model="mail.template">
<field name="name">HR: unknown employee bounce</field>
<field name="subject">Your document has not been created</field>
<field name="email_from">${user.email}</field>
<field name="email_to">${ctx['email_to']|safe}</field>
<field name="lang">${user.lang}</field>
<field name="model_id" ref="base.model_ir_module_module"/>
<field name="auto_delete" eval="True"/>
<field name="body_html" ><![CDATA[Your document has not been created because your email address is not recognized. Please send emails with the email address recorded on your employee information, or contact your HR manager.]]></field>
</record>
</data>
</odoo>