Merge lp:~camptocamp/ocb-addons/7.0-fix-1189524 into lp:ocb-addons

Proposed by Yannick Vaucher @ Camptocamp
Status: Rejected
Rejected by: Stefan Rijnhart (Opener)
Proposed branch: lp:~camptocamp/ocb-addons/7.0-fix-1189524
Merge into: lp:ocb-addons
Diff against target: 16 lines (+8/-0)
1 file modified
project/res_partner.py (+8/-0)
To merge this branch: bzr merge lp:~camptocamp/ocb-addons/7.0-fix-1189524
Reviewer Review Type Date Requested Status
Yannick Vaucher @ Camptocamp Disapprove
Stefan Rijnhart (Opener) Approve
Review via email: mp+168485@code.launchpad.net

Description of the change

[FIX] project - do not copy task_ids of res.partner

For performances and to avoid errors with timesheet_task module on copy.

To post a comment you must log in.
Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

l.13: even if the order of named arguments in OpenERP is conventionally very regular, you might still want to refer to the arguments' names in the call to super, so as to allow for an unexpected API change.

    super(res_partner, self).copy(cr, uid, record_id, default=default, context=context)

instead of

    super(res_partner, self).copy(cr, uid, record_id, default, context)

review: Needs Fixing
Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

Thanks for the review, I just added the argument names

Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

Thanks!

review: Approve
Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

By the way I wonder if this should be done for contract_ids for performances in account/account_analytic_line.py

At least this one doesn't block duplication of partner but I don't see why we would like to copy contracts while duplicating a partner.

Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

Just did the same change as in MP for official (which is now approved)

Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

Merged into lp:openobject-addons/7.0 at revision 9226

Not needed anymore

Please Reject it

review: Disapprove
Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

Rejected as per last comment.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'project/res_partner.py'
2--- project/res_partner.py 2012-12-06 14:56:32 +0000
3+++ project/res_partner.py 2013-06-12 11:52:40 +0000
4@@ -29,6 +29,14 @@
5 'task_ids': fields.one2many('project.task', 'partner_id', 'Tasks'),
6 }
7
8+ def copy(self, cr, uid, record_id, default=None, context=None):
9+ if default is None:
10+ default = {}
11+
12+ default['task_ids'] = []
13+ return super(res_partner, self).copy(
14+ cr, uid, record_id, default=default, context=context)
15+
16 res_partner()
17
18