[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
This commit is contained in:
Bhumi Thakkar (Open ERP) 2012-03-09 17:53:43 +05:30
parent 8f8018fc9a
commit 7942090ef0
2 changed files with 13 additions and 2 deletions

View File

@ -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 <b>Created</b>."), type='notification', need_action_user_id=obj.user_id.id, context=context)
_("Manufacturing Order is <b>Created</b>."), type='notification', context=context)
else :
self.message_append_note(cr, uid, ids, _('System notification'),
_("Manufacturing Order is <b>Created</b>."), 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 <b>done</b>.")
self.message_append_note(cr, uid, ids, '', message, context=context)
return True

View File

@ -410,6 +410,7 @@
<field colspan="4" name="property_ids" nolabel="1" groups="base.group_extended"/>
</page>
</notebook>
<newline/>
<field name="message_ids_social" colspan="4" widget="ThreadView" nolabel="1"/>
</form>
</field>
@ -782,6 +783,9 @@
<field name="move_prod_id" groups="base.group_extended"/>
</page>
</notebook>
<separator string="Temporary Need Action" colspan="4"/>
<field name="need_action_user_id"/>
<newline/>
<field name="message_ids_social" colspan="4" widget="ThreadView" nolabel="1"/>
</form>
</field>