Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
If you are doing via custom module you can do it via XML files. Here is a working example I have in my module. You just have to create a server action and call it from your workflow:
Server action creation (you can access the data stored in your database and include it in your email message using the notation [[object.xxx]], where xxx is the name of the field you want to include):
<?xml version="1.0" encoding="UTF-8"?>
<record id="ir_actions_server_send_email_when_closed_nconf" model="ir.actions.server">
<field name="name">Auto-email when request is closed, not confirmed</field>
<field name="model_id" ref="model_generic_request"/>
<field name="condition">True</field> <!-- might or might not include an extra condition -->
<field name="email">object.requestor.email</field> <!-- get the user email from database -->
<field name="subject">Your request object.name has been closed (not confirmed)</field> <!-- object.name fetches the field from database -->
THIS IS AN AUTOMATED EMAIL. DO NOT REPLY.
We are here to inform you that the request [[object.name]] you submitted on [[object.request_date]] with the following data:
| Request - Details
| Number: [[object.id]]
| Responsible Person: [[object.responsible_name.name]]
| Request description: [[object.request_description]]
| Stating reasons: [[object.stating_reasons]]
| Notes: [[object.notes]]
Has not been confirmed and is closed.
If you have any question, do not hesitate to contact your supervisor.
In the definition of your workflow activities call the action server:
<record model="workflow.activity" id="act_closed_nconf">
<field name="wkf_id" ref="wkf_request" />
<field name="action_id" ref="ir_actions_server_send_email_when_closed_nconf"/>
About This Community
This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 6/11/14, 8:27 AM|
|Seen: 2135 times|
|Last updated: 3/16/15, 8:10 AM|