Merge lp:~savoirfairelinux-openerp/openerp-mgmtsystem/bug-1267840 into lp:openerp-mgmtsystem

Status: Merged
Merged at revision: 91
Proposed branch: lp:~savoirfairelinux-openerp/openerp-mgmtsystem/bug-1267840
Merge into: lp:openerp-mgmtsystem
Diff against target: 83 lines (+9/-9)
4 files modified
mgmtsystem_action/mgmtsystem_action.py (+2/-2)
mgmtsystem_audit/mgmtsystem_audit.py (+3/-3)
mgmtsystem_nonconformity/mgmtsystem_nonconformity.py (+2/-2)
mgmtsystem_nonconformity_deptm/mgmtsystem_nonconformity.py (+2/-2)
To merge this branch: bzr merge lp:~savoirfairelinux-openerp/openerp-mgmtsystem/bug-1267840
Reviewer Review Type Date Requested Status
Maxime Chambreuil (http://www.savoirfairelinux.com) code review Approve
Pedro Manuel Baeza code review Approve
Review via email: mp+201992@code.launchpad.net

Description of the change

Adding values parametter to message_auto_subscribe

To post a comment you must log in.
Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

LGTM

review: Approve (code review)
Revision history for this message
Maxime Chambreuil (http://www.savoirfairelinux.com) (max3903) :
review: Approve (code review)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'mgmtsystem_action/mgmtsystem_action.py'
--- mgmtsystem_action/mgmtsystem_action.py 2013-10-01 16:44:25 +0000
+++ mgmtsystem_action/mgmtsystem_action.py 2014-01-16 20:17:59 +0000
@@ -51,11 +51,11 @@
51 }, context=context)51 }, context=context)
52 return super(mgmtsystem_action, self).create(cr, uid, vals, context=context)52 return super(mgmtsystem_action, self).create(cr, uid, vals, context=context)
5353
54 def message_auto_subscribe(self, cr, uid, ids, updated_fields, context=None):54 def message_auto_subscribe(self, cr, uid, ids, updated_fields, context=None, values=None):
55 """Automatically add the responsible user to the follow list."""55 """Automatically add the responsible user to the follow list."""
56 for o in self.browse(cr, uid, ids, context=context):56 for o in self.browse(cr, uid, ids, context=context):
57 self.message_subscribe_users(cr, uid, ids, user_ids=[o.user_id.id], subtype_ids=None, context=context)57 self.message_subscribe_users(cr, uid, ids, user_ids=[o.user_id.id], subtype_ids=None, context=context)
58 return super(mgmtsystem_action, self).message_auto_subscribe(cr, uid, ids, updated_fields, context=context)58 return super(mgmtsystem_action, self).message_auto_subscribe(cr, uid, ids, updated_fields, context=context, values=values)
5959
60 def case_close(self, cr, uid, ids, context=None):60 def case_close(self, cr, uid, ids, context=None):
61 """When Action is closed, post a message on the related NC's chatter"""61 """When Action is closed, post a message on the related NC's chatter"""
6262
=== modified file 'mgmtsystem_audit/mgmtsystem_audit.py'
--- mgmtsystem_audit/mgmtsystem_audit.py 2013-10-01 16:44:25 +0000
+++ mgmtsystem_audit/mgmtsystem_audit.py 2014-01-16 20:17:59 +0000
@@ -56,21 +56,21 @@
56 vals.update({56 vals.update({
57 'reference': self.pool.get('ir.sequence').get(cr, uid, 'mgmtsystem.audit')57 'reference': self.pool.get('ir.sequence').get(cr, uid, 'mgmtsystem.audit')
58 })58 })
59 return super(mgmtsystem_audit, self).create(cr, uid, vals, context)59 return super(mgmtsystem_audit, self).create(cr, uid, vals, context=context)
6060
61 def button_close(self, cr, uid, ids, context=None):61 def button_close(self, cr, uid, ids, context=None):
62 """When Audit is closed, post a message to followers' chatter."""62 """When Audit is closed, post a message to followers' chatter."""
63 self.message_post(cr, uid, ids, _("Audit closed"), context=context)63 self.message_post(cr, uid, ids, _("Audit closed"), context=context)
64 return self.write(cr, uid, ids, {'state': 'done'})64 return self.write(cr, uid, ids, {'state': 'done'})
6565
66 def message_auto_subscribe(self, cr, uid, ids, updated_fields, context=None):66 def message_auto_subscribe(self, cr, uid, ids, updated_fields, context=None, values=None):
67 """Automatically add the Auditors, Auditees and Audit Manager to the follow list"""67 """Automatically add the Auditors, Auditees and Audit Manager to the follow list"""
68 for o in self.browse(cr, uid, ids, context=context):68 for o in self.browse(cr, uid, ids, context=context):
69 user_ids = [o.user_id.id]69 user_ids = [o.user_id.id]
70 user_ids += [a.id for a in o.auditor_user_ids]70 user_ids += [a.id for a in o.auditor_user_ids]
71 user_ids += [a.id for a in o.auditee_user_ids]71 user_ids += [a.id for a in o.auditee_user_ids]
72 self.message_subscribe_users(cr, uid, ids, user_ids=user_ids, subtype_ids=None, context=context)72 self.message_subscribe_users(cr, uid, ids, user_ids=user_ids, subtype_ids=None, context=context)
73 return super(mgmtsystem_audit, self).message_auto_subscribe(cr, uid, ids, updated_fields, context=context)73 return super(mgmtsystem_audit, self).message_auto_subscribe(cr, uid, ids, updated_fields, context=context, values=values)
7474
75 def get_audit_url(self, cr, uid, ids, context=None):75 def get_audit_url(self, cr, uid, ids, context=None):
76 """76 """
7777
=== modified file 'mgmtsystem_nonconformity/mgmtsystem_nonconformity.py'
--- mgmtsystem_nonconformity/mgmtsystem_nonconformity.py 2013-10-01 16:44:25 +0000
+++ mgmtsystem_nonconformity/mgmtsystem_nonconformity.py 2014-01-16 20:17:59 +0000
@@ -198,12 +198,12 @@
198 })198 })
199 return super(mgmtsystem_nonconformity, self).create(cr, uid, vals, context)199 return super(mgmtsystem_nonconformity, self).create(cr, uid, vals, context)
200200
201 def message_auto_subscribe(self, cr, uid, ids, updated_fields, context=None):201 def message_auto_subscribe(self, cr, uid, ids, updated_fields, context=None, values=None):
202 """Add the reponsible, manager and OpenChatter follow list."""202 """Add the reponsible, manager and OpenChatter follow list."""
203 o = self.browse(cr, uid, ids, context=context)[0]203 o = self.browse(cr, uid, ids, context=context)[0]
204 user_ids = [o.responsible_user_id.id, o.manager_user_id.id, o.author_user_id.id]204 user_ids = [o.responsible_user_id.id, o.manager_user_id.id, o.author_user_id.id]
205 self.message_subscribe_users(cr, uid, ids, user_ids=user_ids, subtype_ids=None, context=context)205 self.message_subscribe_users(cr, uid, ids, user_ids=user_ids, subtype_ids=None, context=context)
206 return super(mgmtsystem_nonconformity, self).message_auto_subscribe(cr, uid, ids, updated_fields=updated_fields, context=context)206 return super(mgmtsystem_nonconformity, self).message_auto_subscribe(cr, uid, ids, updated_fields=updated_fields, context=context, values=values)
207207
208 def case_send_note(self, cr, uid, ids, text, data=None, context=None):208 def case_send_note(self, cr, uid, ids, text, data=None, context=None):
209 for id in ids:209 for id in ids:
210210
=== modified file 'mgmtsystem_nonconformity_deptm/mgmtsystem_nonconformity.py'
--- mgmtsystem_nonconformity_deptm/mgmtsystem_nonconformity.py 2013-09-17 22:08:14 +0000
+++ mgmtsystem_nonconformity_deptm/mgmtsystem_nonconformity.py 2014-01-16 20:17:59 +0000
@@ -38,11 +38,11 @@
38 result['superior_user_id'] = deptm.parent_id.manager_id.user_id.id38 result['superior_user_id'] = deptm.parent_id.manager_id.user_id.id
39 return {'value': result}39 return {'value': result}
4040
41 def message_auto_subscribe(self, cr, uid, ids, updated_fields, context=None):41 def message_auto_subscribe(self, cr, uid, ids, updated_fields, context=None, values=None):
42 """Add the Top Manager to OpenChatter follow list."""42 """Add the Top Manager to OpenChatter follow list."""
43 o = self.browse(cr, uid, ids, context=context)[0]43 o = self.browse(cr, uid, ids, context=context)[0]
44 user_ids = [o.superior_user_id.id]44 user_ids = [o.superior_user_id.id]
45 self.message_subscribe_users(cr, uid, ids, user_ids=user_ids, subtype_ids=None, context=context)45 self.message_subscribe_users(cr, uid, ids, user_ids=user_ids, subtype_ids=None, context=context)
46 return super(mgmtsystem_nonconformity, self).message_auto_subscribe(cr, uid, ids, updated_fields=updated_fields, context=context)46 return super(mgmtsystem_nonconformity, self).message_auto_subscribe(cr, uid, ids, updated_fields=updated_fields, context=context, values=values)
4747
48# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:48# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: