From 7942090ef0c101591df7e8b802e2ac5d960a35f0 Mon Sep 17 00:00:00 2001 From: "Bhumi Thakkar (Open ERP)" Date: Fri, 9 Mar 2012 17:53:43 +0530 Subject: [PATCH] [IMP] remove need_action_user_id from message_append_note method when calling and overwrite get_needaction_user_id method. bzr revid: bth@tinyerp.com-20120309122343-a1adl30bj595cbhn --- addons/mrp/mrp.py | 11 +++++++++-- addons/mrp/mrp_view.xml | 4 ++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index a20eba004da..bc104fabf86 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -523,12 +523,20 @@ class mrp_production(osv.osv): raise osv.except_osv(_('Invalid action !'), _('Cannot delete a manufacturing order in state \'%s\'') % production.state) return super(mrp_production, self).unlink(cr, uid, ids, context=context) + 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 == 'draft' and obj.user_id): + result[obj.id] = obj.user_id.id + return result + def create_notification(self, cr, uid, ids, context=None): for obj in self.browse(cr, uid, ids, context=context): if obj.user_id.id : self.message_subscribe(cr, uid, ids, [obj.user_id.id], context=context) self.message_append_note(cr, uid, ids, _('System notification'), - _("Manufacturing Order is Created."), type='notification', need_action_user_id=obj.user_id.id, context=context) + _("Manufacturing Order is Created."), type='notification', context=context) else : self.message_append_note(cr, uid, ids, _('System notification'), _("Manufacturing Order is Created."), type='notification', context=context) @@ -550,7 +558,6 @@ class mrp_production(osv.osv): return True def done_notification(self, cr, uid, ids, context=None): - self.message_mark_done(cr, uid, ids, context) message = _("Manufacturing order is done.") self.message_append_note(cr, uid, ids, '', message, context=context) return True diff --git a/addons/mrp/mrp_view.xml b/addons/mrp/mrp_view.xml index 32cb2910cb2..c1a1c9a418a 100644 --- a/addons/mrp/mrp_view.xml +++ b/addons/mrp/mrp_view.xml @@ -410,6 +410,7 @@ + @@ -782,6 +783,9 @@ + + +