Automated Task E-mails for OpenERP Project Management

vishnu's picture

    'Automated Task E-mails' is a functionality developed by Zesty Beanz for Automating Task notification emails in OpenERP Project Management. The functionality is achieved as a separate module by extending the project managemnet module in OpenERP.

 

Task E-mails(zb_task_emails)

Module : zb_task_emails

Name : Task E-mails

Version : 6.0.1.0

Author : Zesty Beanz Technologies Pvt Ltd

Website : www.zbeanztech.com

 

Description

* This module allows users to receive notification e-mails, related to tasks in OpenERP Project Management.

* Notifications are sent to 'Assigned User' or 'Project Manager' upon various actions, changes and updates in a particular task

Dependencies

project

hr

smtpclient

Menus

Administration/Configuration/Sendmail Services/Email Templates

 

Views

  * INHERIT email.smtpclient.form(form)

  * INHERIT email.smtpclient.queue.form(form)

  *INHERIT email.smtpclient.queue.tree(tree)

  *INHERIT res.company.form.inherit1(form)

  email.smtpclient.email.template.form(form)

  email.smtpclient.email.template.tree(tree)

Description

     'zb_task_emails' is an extention of the openerp module 'project'. It automates the email notifications related to a particular task. E-mails are sent using the module 'smtpclient'. An email is sent during the following occasions.

  1. Start Task : During the button action an e-mail is sent to the Assigned User. Copy to Project Manager

  2. Done : When a task is completed , e-mail sent to Project Manager. Copy to Assigned User

  3. Reactivate : On reactivating a task, e-mail sent to the Assigned User. Copy to Project Manager

  4. Pending : When a task is set to pending state, e-mail is sent to Project Manager. Copy to Assigned User

  5. Cancel: When a task is cancelled, e-mail is sent to Project Manager. Copy to Assigned User

  6. Task Description Changes: When the description of a task is changed, e-mail is sent to the Assigned User. Copy to Project Manager

  7. Task work entered or updated : When the users enter or modify work detials, e-mail is sent to Project Manager. Copy to Assigned User

  8. Task reassigned : When the task is handed over to another user, e-mail is sent to the newly Assigned User. Copy to Project Manager

  9. Ending date crossed : if a task has no entries in its 'Task Work', even after the ending date of the task, a warning mail is sent to Project Manager. Copy to Assigned User

Configuration

  1. Employee

    Tasks are assigned to users in OpenERP. A user must be an employee to receive e-mail notification. So Create employess and relate them to users. Provide e-mail id in the 'Work E-mail' field of the employee. Automated task e-mails are sent to that particular email id. If an employee doesn't have a 'Work E-mail' , he won't receive notification emails for the tasks he belongs to.

  2. SMTP Server
    Menu : 'Administration/Configuration/Sendmail Services/SMTP Servers'.
    Create a new server with 'type' = 'task' (The field will be available only if the module 'zb_task_emails' is installed). You may check the following link to configure the server easily http://zbeanztech.com/?q=blog/sending-emails-openerp-using-module-smtpclient

  3. Email Templates
    Menu : 'Administration/Configuration/Sendmail Services/Email Templates'.
    Here we define the body of each type of emails with the help of merge fields. The OpenERP fields and corresponding merge fields are mentioned at the bottom of the form. We can define 9 'types' of template, like 'Task', 'Task(Completed)', etc.. You can't have more than one template of the same type. OpenERP will automatically choose the email body from any of these templates and send the the email, based on the action committed by the user.

  4. Task Warning Scheduler
    Menu :'Administration/Configuration/Scheduler/Scheduled Actions'.
    The scheduler checks the 'ending date' of all the tasks in state - 'In Progress', during every pre-defined interval. If the 'Task work' of any of these tasks are found to be empty, in one hour after the scheduled ending time, an email is sent to Project Manager and copy to Assigned User.

     

AttachmentSize
zb_task_emails.zip13.61 KB
muthunaveen's picture

hi vishnu, Your article

hi vishnu, Your article exactly meets my need. Great. Clarify me that this zb_task_emails.zip can be configured for openERP 6.1 version released recently? kindly reply to my mail muthunavaneethakumar@gmail.com

muthunaveen's picture

hey i have downloaded ur

hey i have downloaded ur zb_task_emails.zip and installed in my OpenErp 6.1 stable version through update modules and did the setting, configurations as mentioned in the blog. I have evolution as my default mail setup. It supports SMTP.

But when i create a new task,start task,assign or edit or delete it shows the following error and am unable to proceed.. can u kindly help me in this regard..

Client Traceback (most recent call last):
File "/home1/naveen/Desktop/a/webclient/addons/web/common/http.py", line 180, in dispatch
response["result"] = method(controller, self, **self.params)
File "/home1/naveen/Desktop/a/webclient/addons/web/controllers/main.py", line 1004, in call_button
action = self.call_common(req, model, method, args, domain_id, context_id)
File "/home1/naveen/Desktop/a/webclient/addons/web/controllers/main.py", line 948, in call_common
return self._call_kw(req, model, method, args, {})
File "/home1/naveen/Desktop/a/webclient/addons/web/controllers/main.py", line 962, in _call_kw
return getattr(req.session.model(model), method)(*args, **kwargs)
File "/home1/naveen/Desktop/a/webclient/addons/web/common/openerplib/main.py", line 250, in proxy
args, kw)
File "/home1/naveen/Desktop/a/webclient/addons/web/common/openerplib/main.py", line 117, in proxy
result = self.connector.send(self.service_name, method, *args)
File "/home1/naveen/Desktop/a/webclient/addons/web/common/http.py", line 611, in send
raise fault

Server Traceback (most recent call last):
File "/home1/naveen/Desktop/a/webclient/addons/web/common/http.py", line 592, in send
result = openerp.netsvc.dispatch_rpc(service_name, method, args)
File "/home1/naveen/Desktop/a/server/openerp/netsvc.py", line 360, in dispatch_rpc
result = ExportService.getService(service_name).dispatch(method, params)
File "/home1/naveen/Desktop/a/server/openerp/service/web_services.py", line 572, in dispatch
res = fn(db, uid, *params)
File "/home1/naveen/Desktop/a/server/openerp/osv/osv.py", line 167, in execute_kw
return self.execute(db, uid, obj, method, *args, **kw or {})
File "/home1/naveen/Desktop/a/server/openerp/osv/osv.py", line 121, in wrapper
return f(self, dbname, *args, **kwargs)
File "/home1/naveen/Desktop/a/server/openerp/osv/osv.py", line 176, in execute
res = self.execute_cr(cr, uid, obj, method, *args, **kw)
File "/home1/naveen/Desktop/a/server/openerp/osv/osv.py", line 164, in execute_cr
return getattr(object, method)(cr, uid, *args, **kw)
File "/home1/naveen/Desktop/a/addons/zb_task_emails/project.py", line 44, in do_open
super(task, self).do_open(cr, uid, ids, args)
File "/home1/naveen/Desktop/a/addons/project_mailgate/project_mailgate.py", line 94, in do_open
res = super(project_tasks, self).do_open(cr, uid, ids, context)
File "/home1/naveen/Desktop/a/addons/project/project.py", line 899, in do_open
self.write(cr, uid, [t.id], data, context=context)
File "/home1/naveen/Desktop/a/addons/zb_task_emails/project.py", line 92, in write
result= super(task, self).write(cr, uid, ids, vals, context)
File "/home1/naveen/Desktop/a/addons/project/project.py", line 1049, in write
result = super(task,self).write(cr, uid, ids, vals, context=context)
File "/home1/naveen/Desktop/a/server/openerp/osv/orm.py", line 3833, in write
self._check_concurrency(cr, ids, context)
File "/home1/naveen/Desktop/a/server/openerp/osv/orm.py", line 3599, in _check_concurrency
if not (context.get(self.CONCURRENCY_CHECK_FIELD) and self._log_access):
AttributeError: 'tuple' object has no attribute 'get'

Anonymous's picture

Same problem here, any idea

Same problem here, any idea how to solve that?
thx

juan's picture

Para solucionar el tema de la

Para solucionar el tema de la concurrencia, hay que pasarle un entero y no una lista al write del padre, verifiquen esto en la linea del project.py

la seguna lina cambia agregando el [0] al ids

def write(self, cr, uid, ids, vals, context=None):
# if type(ids) == type(1):
# ids = [ids]
# print ids,type(ids)
if type(ids) != type([]):
ids = [ids]

if len(ids) <> 1:
return super(task, self).write(cr, uid, ids, vals, context)
else:
# Controlo que el contexto sea un diccionario y no una tupla, esto pasa cuando cambiamos de estado, NO SE POR QUE pero esto lo soluciona.
if type(context) is tuple:
context = context[0]
result = super(task, self).write(cr, uid, ids[0], vals, context)
#cr.commit()

Consultoría Innova's picture

I configured the 2 models as

I configured the 2 models as indicated by the post. So far so good.

The problem is that when I try to save or start a task, I get the following error:

* File "/ mnt / data / openerp / server / bin / addons / zb_task_emails.zip / zb_task_emails / project.py", line 85, in pm = tasks.project_id.user_id.id write AttributeError: 'NoneType' object has no attribute 'id'

Could you help me?

Thanks in advance,

Anonymous's picture

por favor para instalar el

por favor para instalar el modulo de zb_task_emails debo tener instalado el modulo de smtpclient, lo he decargado de su pagina pero m da error, porfavor m puede ayudar dandole un link para descragar el modulo de smtp client

gracias

Francis's picture

Hey great module, thanks man.

Hey great module, thanks man. I was wondering I can't seem to get the URL at the bottom of the email sent to change to the ip address of the server instead of saying localhost. Have you got any ideas?

vishnu's picture

Follow the menu,

Follow the menu, "Administration>Companies>Companies". In the "configuration" tab of your company, there is a field, "webclient". Here you can change the url.

SimoneP's picture

Hello, Your module is really

Hello,
Your module is really great, but I have problems with sending mail at the change of status.
The mails are sent only at opening and reopening of the activity.
I don't understand if I miss something in configuration (where I can do it) or if I must to add an action.

Thank you and good job.

Simone

vishnu's picture

one of the reasons is see, is

one of the reasons is see, is an emty list as an in put to the "To" field of the email. Make sure that, the users are employee and they have a work email in their record.