Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to send mail from Any Button in OpenERP/Odoo ?

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 3.54k
    Comment on it

    OpenERP enables utilizer to send and receive emails when an action is done from OpenERP. We can configure emails to be send when a sale is verify or invoice is paid etc. But to implements these type of functionality, we require to update the functions that is being called from these button actions.

    We require to call the send_mail function in these button actions to send mail. OpenERP enables to send mail utilizing Automated Actions but we cannot configure it when a button action is done for example when a report is printed from a button action. This requires conversion in code.

    We have developed a module in such a way that the utilizer will be able to configure to which button action mail is to be send. Utilizer requires some technical erudition about OpenERP like button denomination, button type etc. Module integrates an incipient menu in location Settings -> Button Mail Configuration > Button Mail Configuration where utilizer will be able to configure the button actions.

    Field details that are habituated to configure is given below:

    1- Name : Name of the configuration. Main purport of this field is for identification of configuration.
    2- Model : Model for which the mail is to be send. The button action should belong to the model defined in this field.

    3- Method : The designation of the button for which the mail is to be send. Name of the button can be ascertained by enabling the debug mode of OpenERP.

    4-Button Type : If the button is of type Object or Workflow. Object buttons will call a python function when clicked and the workflow button will send a workflow signal to trigger a workflow process. If there is attribute in button definition as then it is a object button. If there is no type attribute in button definition, its a workflow button.

    5-Send Mail After : If the mail is to send after function execution. After workflow trigger incase of workflow buttons.

    6-Send Mail ahead : If the mail is to send afore function execution. Afore workflow trigger incase of workflow buttons.

    7-Email Template : Email template to be utilized for sending mail. Template can be defined from the menu Settings > Technical > Email > Templates. Here you can define the the mail sender and recipient addresses, mail body etc.

    8-Resource ID Field : Expression to fetch the resource id to utilize for sending the electronic mails. Argument like ids, context and all the arguments that are passed to the function being called can be realize from a dictionary arguments. For example argument.get('ids', []) or argument.get('context', {}).get('active_ids', []). This option will be available for button actions of type "Object".
    After that configuration has been send .

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: