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

Send Mail From Any Button From OpenERP

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:

Anonymous's picture

Open ER is the best software

Open ER is the best software which will have great contact and you have to feel very good to use this tool easily. Get you best thing at the papersowl review so you will receive the detail what you need to know how you feel with it.

gmail sign up's picture

Thanks a lot for the post. It

Thanks a lot for the post. It has helped me get some nice ideas. I hope I will see some really good result soon.

gmail sign up
hotmail email login