Odoo Help

Welcome!

This community 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.

0

Create TODO message automatically based on some event

By
ASP
on 5/27/14, 9:14 AM 1,029 views

Hi Guys, 

I'm looking for how can we create a new TODO message automatically with some string message each time, I click a button in my custom moule.

Please share some idea and help me with this. Any help would be appreciated :)

 

Cheers
ASP :)

-1

I'm not sure of what you are asking, but I guess a server action might do the trick. You can create a server action in OpenERP Settings »» Technical »» Actions »» Server Actions or creating a XML on your module. I'll leave here an example of a server action I'm using to send an email to user when an object reaches a certain status on a module I'm developing:

Note: This action is called from workflow

<?xml version="1.0" encoding="UTF-8"?>
<openerp>
    <data>
        <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="state">email</field>
            <field name="type">ir.actions.server</field>
            <field name="condition">True</field>
            <field name="email">object.requestor.email</field>
            <field name="subject">Your request object.name has been closed (not confirmed)</field>
            <field name="message"><![CDATA[
THIS IS AN AUTOMATED EMAIL. DO NOT REPLY.

Hello,

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.

Thank you!]]>
            </field>            
        </record>
    </data>
</openerp>

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)

Stats

Asked: 5/27/14, 9:14 AM
Seen: 1029 times
Last updated: 3/16/15, 8:10 AM