diff options
| author | Olivier Dony <odo@openerp.com> | 2013-01-10 18:27:23 +0100 |
|---|---|---|
| committer | Olivier Dony <odo@openerp.com> | 2013-01-10 18:27:23 +0100 |
| commit | ad70edb40b4294468c5cc4f7bcd3b6d4c1b4e334 (patch) | |
| tree | 92c52af90b7c09eef21082b098ba1639bc74a7cc /addons/project/project.py | |
| parent | 943453798652f3749f1b40fb9f350be743a9eac0 (diff) | |
[FIX] mail_thread subclasses: message_new must not override the explicitly provided ``custom_values``
This was the case before, but was broken involuntarily during the
big mail refactoring for v7. The default values provided by
custom message_new methods should only be used as defaults.
bzr revid: odo@openerp.com-20130110172723-ym7mcmdllcucj0j3
Diffstat (limited to 'addons/project/project.py')
| -rw-r--r-- | addons/project/project.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/addons/project/project.py b/addons/project/project.py index 3c7c180ebb3..95f7771afce 100644 --- a/addons/project/project.py +++ b/addons/project/project.py @@ -1174,11 +1174,12 @@ class task(base_stage, osv.osv): def message_new(self, cr, uid, msg, custom_values=None, context=None): """ Override to updates the document according to the email. """ if custom_values is None: custom_values = {} - custom_values.update({ + defaults = { 'name': msg.get('subject'), 'planned_hours': 0.0, - }) - return super(task,self).message_new(cr, uid, msg, custom_values=custom_values, context=context) + } + defaults.update(custom_values) + return super(task,self).message_new(cr, uid, msg, custom_values=defaults, context=context) def message_update(self, cr, uid, ids, msg, update_vals=None, context=None): """ Override to update the task according to the email. """ |
