India

ZestyBeanz Technologies Pvt Ltd 4th Floor, Nila, Technopark Thiruvananthapuram,
India – 695581
Phone: +91 471 4063254
Fax : +91 471 2700171

   .

ZestyBeanz Technologies Pvt Ltd
61/3236, Manikkath Cross Road
Ravipuram, Kochi, India - 682016
Phone: +91 484 4063254

  UAE

Zesty Labs
Office # 2003, Millennium Plaza Building
Sheikh Zayed Rd, Dubai, UAE
Phone: +971 4333 2222​
Mobile: +971-52-7553466

  Germany​

ZestyBeanz Technologies GmbH
Reuterstraße 1
90408 Nürnberg
Fon: +49 911 4801 444
Fax: +49 911 4801 445

Contact Form


Prajul P T's picture

Send Mail From Any Button From OpenERP

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

We need to call the send_mail function in these button actions to send mail. OpenERP enables to send mail using “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 change in code.

We have developed a module in such a way that the user will be able to configure to which button action mail is to be send. User requires some technical knowledge about OpenERP like button name, button type etc. Module adds a new menu in location “Settings > Button Mail Configuration > Button Mail Configuration” where user will be able to configure the button actions. A screenshot is shown below:

Field details that are used to configure is given below:

  1. Name : Name of the configuration. Main purpose 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 name of the button for which the mail is to be send. Name of the button can be found out 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 <button….. type=”object”.../> then it is a object button. If there is no type attribute in button definition, its a workflow button. An screenshot showing the workflow button and object button in fields_view_get window from debug mode is shown below: 

      

  5. Send Mail After : If the mail is to send after function execution. After workflow trigger incase of workflow buttons.
  6. Send Mail Before : If the mail is to send before function execution. Before workflow trigger incase of workflow buttons.
  7. Email Template : Email template to be used 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 use for sending the emails. Argument like ids, context and all the arguments that are passed to the function being called can be fetched 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". A screenshot of configuration to send mails on confirming a quotation is given below:

This configuration will send mail after triggering the purchase_confirm workflow signal.

 

Model : Model for which the mail is to be send. The button action should belong to the model defined in this field.
Method : The name of the button for which the mail is to be send. Name of the button can be found out by enabling the debug mode of OpenERP.
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 <button….. type=”object”.../> then it is a object button. If there is no type attribute in button definition, its a workflow button. An screenshot showing the workflow button and object button in fields_view_get window from debug mode is shown below:
Model : Model for which the mail is to be send. The button action should belong to the model defined in this field.
Method : The name of the button for which the mail is to be send. Name of the button can be found out by enabling the debug mode of OpenERP.
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 <button….. type=”object”.../> then it is a object button. If there is no type attribute in button definition, its a workflow button. An screenshot showing the workflow button and object button in fields_view_get window from debug mode is shown below:

Reply

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. The supported tag styles are: <foo>, [foo], [[foo]]. PHP source code can also be enclosed in <?php ... ?> or <% ... %>.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image. Ignore spaces and be careful about upper and lower case.