diff --git a/addons/hr_holidays/hr_holidays.py b/addons/hr_holidays/hr_holidays.py
index f63dcf9632d..d5331624350 100644
--- a/addons/hr_holidays/hr_holidays.py
+++ b/addons/hr_holidays/hr_holidays.py
@@ -358,6 +358,14 @@ class hr_holidays(osv.osv):
# OpenChatter and notifications
# -----------------------------
+ def get_needaction_user_id(self, cr, uid, ids, name, arg, context=None):
+ result = {}
+ for obj in self.browse(cr, uid, ids, context=context):
+ result[obj.id] = False
+ if (obj.state == 'confirm' and obj.employee_id.parent_id):
+ result[obj.id] = obj.employee_id.parent_id.user_id.id
+ return result
+
def message_get_subscribers(self, cr, uid, ids, context=None):
sub_ids = self._message_get_subscribers_ids(cr, uid, ids, context=context);
# add the employee and its manager if specified to the subscribed users
@@ -377,12 +385,10 @@ class hr_holidays(osv.osv):
for obj in self.browse(cr, uid, ids):
self.message_append_note(cr, uid, [obj.id], _('System notification'),
_("The %s request '%s' has been confirmed and is waiting for validation by the manager.")
- % ('leave' if obj.type == 'remove' else 'allocation', obj.name,), type='notification',
- need_action_user_id = obj.employee_id.parent_id.user_id.id if obj.employee_id.parent_id else False)
+ % ('leave' if obj.type == 'remove' else 'allocation', obj.name,), type='notification')
def holidays_validate_notificate(self, cr, uid, ids, context=None):
for obj in self.browse(cr, uid, ids):
- self.message_mark_done(cr, uid, [obj.id], context=context)
if obj.holiday_status_id.double_validation:
self.message_append_note(cr, uid, [obj.id], _('System notification'),
_("The %s request '%s' has been validated. A second validation is necessary and is now pending.")
diff --git a/addons/hr_holidays/hr_holidays_view.xml b/addons/hr_holidays/hr_holidays_view.xml
index 2096ae2bc61..2501ce50ad3 100644
--- a/addons/hr_holidays/hr_holidays_view.xml
+++ b/addons/hr_holidays/hr_holidays_view.xml
@@ -95,6 +95,9 @@
+
+
+
diff --git a/addons/mail/base_needaction.py b/addons/mail/base_needaction.py
index 1c7797a9072..bebbd2555d3 100644
--- a/addons/mail/base_needaction.py
+++ b/addons/mail/base_needaction.py
@@ -31,7 +31,40 @@ class mail_needaction(osv.osv):
_name = 'mail.needaction'
_description = 'Need action Engine'
+ def get_needaction_user_id(self, cr, uid, ids, name, arg, context=None):
+ if context is None:
+ context = {}
+ result = {}
+ for obj in self.browse(cr, uid, ids, context=context):
+ result[obj.id] = False
+ return result
+
+ #def set_needaction_user_id(self, cr, uid, id, name, value, arg, context=None):
+ #"""
+ #@param name: Name of field
+ #@param value: Value of field
+ #@param arg: User defined argument
+ #"""
+ #if context is None:
+ #context = {}
+ #return self.write(cr, uid, [id], {name: value}, context=context)
+
+ def get_needaction_user_id_wrapper(self, cr, uid, ids, name, arg, context=None):
+ return self.get_needaction_user_id(cr, uid, ids, name, arg, context=context)
+
+ def set_needaction_user_id_wrapper(self, cr, uid, id, name, value, arg, context=None):
+ return self.set_needaction_user_id(cr, uid, id, name, value, arg, context=context)
+
_columns = {
+ 'need_action': fields.boolean('Need action'),
+ 'need_action_user_id': fields.function(get_needaction_user_id_wrapper,
+ #fnct_inv=set_needaction_user_id_wrapper,
+ type='many2one', relation='res.users', store=True, string='User'),
+
+ }
+
+ _defaults = {
+ 'need_action': False,
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/mail/mail_message.py b/addons/mail/mail_message.py
index 8b89b61801f..41a1c636092 100644
--- a/addons/mail/mail_message.py
+++ b/addons/mail/mail_message.py
@@ -184,7 +184,6 @@ class mail_message(osv.osv):
('comment', 'Comment'),
('notification', 'System notification'),
], 'Type', help="Message type: e-mail for e-mail message, notification for system message, comment for other messages such as user replies"),
- 'need_action_user_id': fields.many2one('res.users', 'Action by user', help="User requested to perform an action"),
}
_defaults = {