diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py
index d1500850afb..a6e42dd211e 100644
--- a/addons/crm/__openerp__.py
+++ b/addons/crm/__openerp__.py
@@ -83,7 +83,7 @@ Create dashboard for CRM that includes:
'wizard/crm_opportunity_to_phonecall_view.xml',
'wizard/crm_partner_to_opportunity_view.xml',
- 'wizard/crm_send_email_view.xml',
+# 'wizard/crm_send_email_view.xml',
'wizard/crm_add_note_view.xml',
'wizard/crm_merge_opportunities_view.xml',
diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml
index 2546ee0ca0f..5d7e6eac039 100644
--- a/addons/crm/crm_lead_view.xml
+++ b/addons/crm/crm_lead_view.xml
@@ -13,8 +13,8 @@
{'type':'lead'}Add specific stages to leads and opportunities allowing your sales to better organise their sales pipeline. Stages will allow them to easily track how a specific lead or opportunity is positioned in the sales cycle.
-
-
+
+
diff --git a/addons/crm/crm_opportunity_view.xml b/addons/crm/crm_opportunity_view.xml
index ee41e865b2d..59ae2e7dbff 100644
--- a/addons/crm/crm_opportunity_view.xml
+++ b/addons/crm/crm_opportunity_view.xml
@@ -1,7 +1,7 @@
-
+
Stagescrm.case.stage
@@ -11,13 +11,13 @@
{'type':'opportunity'}Create specific stages that will help your sales better organise their sales pipeline by maintaining them to their sales opportunities. It will allow them to easily track how is positioned a specific opportunity in the sales cycle.
-
+
-
+
Opportunities
@@ -154,11 +154,10 @@
-
+
-
+
@@ -75,15 +75,10 @@
-
-
-
-
-
@@ -164,11 +159,11 @@
-
+
-
-
+
diff --git a/addons/hr_evaluation/__openerp__.py b/addons/hr_evaluation/__openerp__.py
index ec78dcc8643..b7cfaf96489 100644
--- a/addons/hr_evaluation/__openerp__.py
+++ b/addons/hr_evaluation/__openerp__.py
@@ -41,7 +41,7 @@
"update_xml": [
"security/ir.model.access.csv",
"security/hr_evaluation_security.xml",
- "wizard/hr_evaluation_mail_view.xml",
+# "wizard/hr_evaluation_mail_view.xml",
"hr_evaluation_view.xml",
"report/hr_evaluation_report_view.xml",
"board_hr_evaluation_view.xml"
diff --git a/addons/hr_evaluation/hr_evaluation_view.xml b/addons/hr_evaluation/hr_evaluation_view.xml
index 99f34f7cc7b..b144946a685 100644
--- a/addons/hr_evaluation/hr_evaluation_view.xml
+++ b/addons/hr_evaluation/hr_evaluation_view.xml
@@ -250,12 +250,12 @@
-
+
-
+
@@ -399,17 +399,30 @@
+
+
+
+ Send E-mail
+ email.compose.message
+ email.compose.message
+ ir.actions.act_window
+ form
+ form
+ {'email_model':'hr.evaluation.interview'}
+ new
+
+
+ action="action_email_compose_message_menu_wizard" sequence="45" groups="base.group_hr_manager"/>
-
diff --git a/addons/hr_evaluation/wizard/__init__.py b/addons/hr_evaluation/wizard/__init__.py
index 1a855087bbc..7036af4f659 100644
--- a/addons/hr_evaluation/wizard/__init__.py
+++ b/addons/hr_evaluation/wizard/__init__.py
@@ -19,6 +19,7 @@
#
##############################################################################
-import hr_evaluation_mail
+#import hr_evaluation_mail
+import email_compose_message
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/hr_evaluation/wizard/email_compose_message.py b/addons/hr_evaluation/wizard/email_compose_message.py
new file mode 100644
index 00000000000..1b72fff3f2e
--- /dev/null
+++ b/addons/hr_evaluation/wizard/email_compose_message.py
@@ -0,0 +1,80 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2010-Today OpenERP SA ()
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see
+#
+##############################################################################
+
+from osv import osv
+from osv import fields
+import tools
+from tools.translate import _
+
+class email_compose_message(osv.osv_memory):
+ _inherit = 'email.compose.message'
+
+ def default_get(self, cr, uid, fields, context=None):
+ if context is None:
+ context = {}
+ result = super(email_compose_message, self).default_get(cr, uid, fields, context=context)
+ if context.get('email_model',False) and context.get('email_model') == 'hr.evaluation.interview' and 'model' in fields:
+ result['model'] = context.get('email_model','')
+ return result
+
+ def _get_records(self, cr, uid, context=None):
+ """
+ Return Records of particular Model
+ """
+ if context is None:
+ context = {}
+ record_ids = []
+ if context.get('email_model',False) and context.get('email_model') == 'hr.evaluation.interview':
+ model_pool = self.pool.get(context.get('email_model'))
+ record_ids = model_pool.search(cr, uid, [('state','=','waiting_answer')])
+ return model_pool.name_get(cr, uid, record_ids, context)
+ else:
+ return super(email_compose_message, self)._get_records(cr, uid, context=context)
+
+ _columns = {
+ 'resource_id':fields.selection(_get_records, 'Referred Document'),
+ }
+
+ def on_change_referred_doc(self, cr, uid, ids, model, resource_id, context=None):
+ if context is None:
+ context = {}
+ if context.get('mail') == 'reply':
+ return {'value':{}}
+ result = super(email_compose_message, self).on_change_referred_doc(cr, uid, ids, model, resource_id, context=context)
+ value = {}
+ if not result.get('value'):
+ result.update({'value':{}})
+
+ if model == 'hr.evaluation.interview' and resource_id:
+ model_pool = self.pool.get(model)
+ record_data = model_pool.browse(cr, uid, resource_id, context)
+ if record_data.state == "waiting_answer":
+ msg = _("Hello %s, \n\n Kindly post your response for '%s' survey interview. \n\n Thanks,") %(record_data.user_to_review_id.name, record_data.survey_id.title)
+ result['value'].update({'email_from': tools.config.get('email_from','')})
+ result['value'].update({'email_to': record_data.user_to_review_id.work_email or False})
+ result['value'].update({'name': _("Reminder to fill up Survey")})
+ result['value'].update({'description': msg })
+ result['value'].update({'res_id': resource_id})
+ return result
+
+email_compose_message()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/hr_recruitment/hr_recruitment_view.xml b/addons/hr_recruitment/hr_recruitment_view.xml
index 3738a1d8be6..0d0da8d3d34 100644
--- a/addons/hr_recruitment/hr_recruitment_view.xml
+++ b/addons/hr_recruitment/hr_recruitment_view.xml
@@ -145,11 +145,11 @@
-
+
@@ -164,11 +164,10 @@
-
+
@@ -180,14 +179,14 @@
-
-
+
diff --git a/addons/project/__openerp__.py b/addons/project/__openerp__.py
index 301600d25c7..b32a9b86f74 100644
--- a/addons/project/__openerp__.py
+++ b/addons/project/__openerp__.py
@@ -37,7 +37,7 @@ work done on tasks, eso. It is able to render planning, order tasks, eso.
"update_xml": [
"security/project_security.xml",
"wizard/project_task_delegate_view.xml",
- "wizard/project_task_close_view.xml",
+# "wizard/project_task_close_view.xml",
"wizard/project_task_reevaluate_view.xml",
"security/ir.model.access.csv",
"project_data.xml",
diff --git a/addons/project/wizard/__init__.py b/addons/project/wizard/__init__.py
index 69e1051e621..5225a2d661e 100644
--- a/addons/project/wizard/__init__.py
+++ b/addons/project/wizard/__init__.py
@@ -19,7 +19,8 @@
#
##############################################################################
-import project_task_close
+#import project_task_close
+import email_compose_message
import project_task_delegate
import project_task_reevaluate
diff --git a/addons/project/wizard/email_compose_message.py b/addons/project/wizard/email_compose_message.py
new file mode 100644
index 00000000000..042cdd61a30
--- /dev/null
+++ b/addons/project/wizard/email_compose_message.py
@@ -0,0 +1,81 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2010-Today OpenERP SA ()
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see
+#
+##############################################################################
+
+from osv import osv
+from osv import fields
+from tools.translate import _
+
+class email_compose_message(osv.osv_memory):
+ _inherit = 'email.compose.message'
+
+ def default_get(self, cr, uid, fields, context=None):
+ if context is None:
+ context = {}
+ result = super(email_compose_message, self).default_get(cr, uid, fields, context=context)
+ if context.get('active_id',False) and context.get('active_model',False) and context.get('active_model') == 'project.task':
+ task_pool = self.pool.get('project.task')
+ task_data = task_pool.browse(cr, uid, context.get('active_id'), context=context)
+ project = task_data.project_id
+ manager = project.user_id or False
+ partner = task_data.partner_id or task_data.project_id.partner_id
+
+ if project.warn_manager and (not manager or manager and not manager.user_email) :
+ raise osv.except_osv(_('Error'), _("Please specify the Project Manager or email address of Project Manager."))
+ elif project.warn_customer and (not partner or not len(partner.address) or (partner and len(partner.address) and not partner.address[0].email)):
+ raise osv.except_osv(_('Error'), _("Please specify the Customer or email address of Customer."))
+
+ if 'email_from' in fields:
+ result.update({'email_from': task_data.user_id and task_data.user_id.user_email or False})
+
+ if 'description' in fields:
+ val = {
+ 'name': task_data.name,
+ 'user_id': task_data.user_id.name,
+ 'task_id': "%d/%d" % (project.id, task_data.id),
+ 'date_start': task_data.date_start,
+ 'date': task_data.date_end,
+ 'state': task_data.state
+ }
+ header = (project.warn_header or '') % val
+ footer = (project.warn_footer or '') % val
+ description = u'%s\n %s\n %s\n\n \n%s' % (header, task_data.description or '', footer, task_data.user_id and task_data.user_id.signature)
+ result.update({'description': description or False})
+
+ if 'email_to' in fields:
+ result.update({'email_to': manager and manager.user_email or False})
+
+ if partner and len(partner.address) and 'email_to' in fields:
+ result.update({'email_to': result.get('email_to',False) and result.get('email_to') + ',' + partner.address[0].email})
+
+ if 'name' in fields:
+ result.update({'name': _("Task '%s' Closed") % task_data.name})
+
+ if 'model' in fields:
+ result.update({'model':context.get('active_model')})
+
+ if 'res_id' in fields:
+ result.update({'res_id':context.get('active_id')})
+
+ return result
+
+email_compose_message()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py
index 9e82eb01556..dce28737bfd 100644
--- a/addons/project_issue/project_issue.py
+++ b/addons/project_issue/project_issue.py
@@ -27,7 +27,6 @@ import binascii
import time
import tools
-
class project_issue_version(osv.osv):
_name = "project.issue.version"
_order = "name desc"
diff --git a/addons/project_issue/project_issue_view.xml b/addons/project_issue/project_issue_view.xml
index 23a361b0ff9..f8f4f84964f 100644
--- a/addons/project_issue/project_issue_view.xml
+++ b/addons/project_issue/project_issue_view.xml
@@ -101,11 +101,11 @@
-
+
@@ -120,11 +120,10 @@
-
+
@@ -141,10 +140,10 @@
name="%(crm.action_crm_add_note)d"
context="{'model': 'crm.lead' }"
icon="terp-document-new" type="action" />
-
+
diff --git a/addons/project_planning/project_planning_view.xml b/addons/project_planning/project_planning_view.xml
index ef39b5daad9..11ced59634b 100644
--- a/addons/project_planning/project_planning_view.xml
+++ b/addons/project_planning/project_planning_view.xml
@@ -109,7 +109,7 @@
-
+
diff --git a/addons/project_scrum/__openerp__.py b/addons/project_scrum/__openerp__.py
index 90b596da2cf..eb86798c493 100644
--- a/addons/project_scrum/__openerp__.py
+++ b/addons/project_scrum/__openerp__.py
@@ -55,7 +55,7 @@
'wizard/project_scrum_backlog_create_task_view.xml',
'wizard/project_scrum_backlog_merger_view.xml',
'wizard/project_scrum_postpone_view.xml',
- "wizard/project_scrum_email_view.xml",
+# "wizard/project_scrum_email_view.xml",
'project_scrum_view.xml',
'wizard/project_scrum_backlog_sprint_view.xml',
'process/project_scrum_process.xml',
diff --git a/addons/project_scrum/project_scrum_view.xml b/addons/project_scrum/project_scrum_view.xml
index 32ed240cba6..fe874818157 100644
--- a/addons/project_scrum/project_scrum_view.xml
+++ b/addons/project_scrum/project_scrum_view.xml
@@ -394,7 +394,9 @@
-
+
diff --git a/addons/project_scrum/wizard/__init__.py b/addons/project_scrum/wizard/__init__.py
index 4b5b0919574..2a643f0fa5f 100644
--- a/addons/project_scrum/wizard/__init__.py
+++ b/addons/project_scrum/wizard/__init__.py
@@ -23,7 +23,8 @@ import project_scrum_backlog_create_task
import project_scrum_backlog_sprint
import project_scrum_backlog_merger
import project_scrum_postpone
-import project_scrum_email
+#import project_scrum_email
+import email_compose_message
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/project_scrum/wizard/email_compose_message.py b/addons/project_scrum/wizard/email_compose_message.py
new file mode 100644
index 00000000000..e479c1bdb14
--- /dev/null
+++ b/addons/project_scrum/wizard/email_compose_message.py
@@ -0,0 +1,69 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2010-Today OpenERP SA ()
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see
+#
+##############################################################################
+
+from osv import osv
+from osv import fields
+from tools.translate import _
+
+class email_compose_message(osv.osv_memory):
+ _inherit = 'email.compose.message'
+
+ def default_get(self, cr, uid, fields, context=None):
+ if context is None:
+ context = {}
+ result = super(email_compose_message, self).default_get(cr, uid, fields, context=context)
+
+ if context.get('active_id',False) and context.get('active_model',False) and context.get('active_model') == 'project.scrum.meeting':
+
+ meeting_pool = self.pool.get('project.scrum.meeting')
+ user_pool = self.pool.get('res.users')
+ meeting = meeting_pool.browse(cr, uid, context.get('active_id'), context=context)
+ sprint = meeting.sprint_id
+
+ if 'email_from' in fields:
+ user_data = user_pool.browse(cr, uid, uid, context=context)
+ result.update({'email_from': user_data.address_id and user_data.address_id.email or False})
+
+ if 'email_to' in fields and sprint.scrum_master_id and sprint.scrum_master_id.user_email:
+ result.update({'email_to': sprint.scrum_master_id.user_email})
+
+ if sprint.product_owner_id and sprint.product_owner_id.user_email:
+ result.update({'email_to': result.get('email_to',False) and result.get('email_to') + ',' + sprint.product_owner_id.user_email or sprint.product_owner_id.user_email})
+
+ if 'name' in fields:
+ subject = _("Scrum Meeting : %s") %(meeting.date)
+ result.update({'name': subject})
+
+ if 'description' in fields:
+ message = _("Hello , \nI am sending you Scrum Meeting : %s for the Sprint '%s' of Project '%s'") %(meeting.date, sprint.name, sprint.project_id.name)
+ result.update({'description': message})
+
+ if 'model' in fields:
+ result.update({'model':context.get('active_model')})
+
+ if 'res_id' in fields:
+ result.update({'res_id':context.get('active_id')})
+
+ return result
+
+email_compose_message()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: