summaryrefslogtreecommitdiff
path: root/addons/hr_expense/data
diff options
context:
space:
mode:
authorYannick Tivisse <yti@odoo.com>2016-08-18 13:56:42 +0200
committerYannick Tivisse <yti@odoo.com>2016-08-25 14:55:08 +0200
commit47728ccd407f683ef22ac9095b88dedbacfb0ef2 (patch)
tree7cb3ae837be334dc24491d4b17b1740a6681cf15 /addons/hr_expense/data
parent920b791ac5751fe5c4c71403b616d9c33b5f19d9 (diff)
[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.
Diffstat (limited to 'addons/hr_expense/data')
-rw-r--r--addons/hr_expense/data/hr_expense_data.xml11
1 files changed, 1 insertions, 10 deletions
diff --git a/addons/hr_expense/data/hr_expense_data.xml b/addons/hr_expense/data/hr_expense_data.xml
index 3ca4fed609c..425fb3a6e79 100644
--- a/addons/hr_expense/data/hr_expense_data.xml
+++ b/addons/hr_expense/data/hr_expense_data.xml
@@ -17,6 +17,7 @@
<field name="alias_name">expense</field>
<field name="alias_model_id" ref="model_hr_expense"/>
<field name="alias_user_id" ref="base.user_root"/>
+ <field name="alias_contact">employees</field>
</record>
@@ -65,15 +66,5 @@
<field name="sequence" eval="10"/>
</record>
- <record id="mail_template_data_expense_unknown_email_address" model="mail.template">
- <field name="name">HrExpense: unknown employee bounce</field>
- <field name="subject">Your expense has not been created</field>
- <field name="email_from">help@odoo.com</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 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.]]></field>
- </record>
</data>
</odoo>