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
1=== modified file 'mgmtsystem_action/mgmtsystem_action.py'
2--- mgmtsystem_action/mgmtsystem_action.py 2013-10-01 16:44:25 +0000
3+++ mgmtsystem_action/mgmtsystem_action.py 2014-01-16 20:17:59 +0000
4@@ -51,11 +51,11 @@
5 }, context=context)
6 return super(mgmtsystem_action, self).create(cr, uid, vals, context=context)
7
8- def message_auto_subscribe(self, cr, uid, ids, updated_fields, context=None):
9+ def message_auto_subscribe(self, cr, uid, ids, updated_fields, context=None, values=None):
10 """Automatically add the responsible user to the follow list."""
11 for o in self.browse(cr, uid, ids, context=context):
12 self.message_subscribe_users(cr, uid, ids, user_ids=[o.user_id.id], subtype_ids=None, context=context)
13- return super(mgmtsystem_action, self).message_auto_subscribe(cr, uid, ids, updated_fields, context=context)
14+ return super(mgmtsystem_action, self).message_auto_subscribe(cr, uid, ids, updated_fields, context=context, values=values)
15
16 def case_close(self, cr, uid, ids, context=None):
17 """When Action is closed, post a message on the related NC's chatter"""
18
19=== modified file 'mgmtsystem_audit/mgmtsystem_audit.py'
20--- mgmtsystem_audit/mgmtsystem_audit.py 2013-10-01 16:44:25 +0000
21+++ mgmtsystem_audit/mgmtsystem_audit.py 2014-01-16 20:17:59 +0000
22@@ -56,21 +56,21 @@
23 vals.update({
24 'reference': self.pool.get('ir.sequence').get(cr, uid, 'mgmtsystem.audit')
25 })
26- return super(mgmtsystem_audit, self).create(cr, uid, vals, context)
27+ return super(mgmtsystem_audit, self).create(cr, uid, vals, context=context)
28
29 def button_close(self, cr, uid, ids, context=None):
30 """When Audit is closed, post a message to followers' chatter."""
31 self.message_post(cr, uid, ids, _("Audit closed"), context=context)
32 return self.write(cr, uid, ids, {'state': 'done'})
33
34- def message_auto_subscribe(self, cr, uid, ids, updated_fields, context=None):
35+ def message_auto_subscribe(self, cr, uid, ids, updated_fields, context=None, values=None):
36 """Automatically add the Auditors, Auditees and Audit Manager to the follow list"""
37 for o in self.browse(cr, uid, ids, context=context):
38 user_ids = [o.user_id.id]
39 user_ids += [a.id for a in o.auditor_user_ids]
40 user_ids += [a.id for a in o.auditee_user_ids]
41 self.message_subscribe_users(cr, uid, ids, user_ids=user_ids, subtype_ids=None, context=context)
42- return super(mgmtsystem_audit, self).message_auto_subscribe(cr, uid, ids, updated_fields, context=context)
43+ return super(mgmtsystem_audit, self).message_auto_subscribe(cr, uid, ids, updated_fields, context=context, values=values)
44
45 def get_audit_url(self, cr, uid, ids, context=None):
46 """
47
48=== modified file 'mgmtsystem_nonconformity/mgmtsystem_nonconformity.py'
49--- mgmtsystem_nonconformity/mgmtsystem_nonconformity.py 2013-10-01 16:44:25 +0000
50+++ mgmtsystem_nonconformity/mgmtsystem_nonconformity.py 2014-01-16 20:17:59 +0000
51@@ -198,12 +198,12 @@
52 })
53 return super(mgmtsystem_nonconformity, self).create(cr, uid, vals, context)
54
55- def message_auto_subscribe(self, cr, uid, ids, updated_fields, context=None):
56+ def message_auto_subscribe(self, cr, uid, ids, updated_fields, context=None, values=None):
57 """Add the reponsible, manager and OpenChatter follow list."""
58 o = self.browse(cr, uid, ids, context=context)[0]
59 user_ids = [o.responsible_user_id.id, o.manager_user_id.id, o.author_user_id.id]
60 self.message_subscribe_users(cr, uid, ids, user_ids=user_ids, subtype_ids=None, context=context)
61- return super(mgmtsystem_nonconformity, self).message_auto_subscribe(cr, uid, ids, updated_fields=updated_fields, context=context)
62+ return super(mgmtsystem_nonconformity, self).message_auto_subscribe(cr, uid, ids, updated_fields=updated_fields, context=context, values=values)
63
64 def case_send_note(self, cr, uid, ids, text, data=None, context=None):
65 for id in ids:
66
67=== modified file 'mgmtsystem_nonconformity_deptm/mgmtsystem_nonconformity.py'
68--- mgmtsystem_nonconformity_deptm/mgmtsystem_nonconformity.py 2013-09-17 22:08:14 +0000
69+++ mgmtsystem_nonconformity_deptm/mgmtsystem_nonconformity.py 2014-01-16 20:17:59 +0000
70@@ -38,11 +38,11 @@
71 result['superior_user_id'] = deptm.parent_id.manager_id.user_id.id
72 return {'value': result}
73
74- def message_auto_subscribe(self, cr, uid, ids, updated_fields, context=None):
75+ def message_auto_subscribe(self, cr, uid, ids, updated_fields, context=None, values=None):
76 """Add the Top Manager to OpenChatter follow list."""
77 o = self.browse(cr, uid, ids, context=context)[0]
78 user_ids = [o.superior_user_id.id]
79 self.message_subscribe_users(cr, uid, ids, user_ids=user_ids, subtype_ids=None, context=context)
80- return super(mgmtsystem_nonconformity, self).message_auto_subscribe(cr, uid, ids, updated_fields=updated_fields, context=context)
81+ return super(mgmtsystem_nonconformity, self).message_auto_subscribe(cr, uid, ids, updated_fields=updated_fields, context=context, values=values)
82
83 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: