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

Proposed by Yannick Vaucher @ Camptocamp
Status: Rejected
Rejected by: Holger Brunn (Therp)
Proposed branch: lp:~camptocamp/ocb-addons/7.0-fix-1335887
Merge into: lp:ocb-addons
Diff against target: 17 lines (+5/-2)
1 file modified
purchase/purchase.py (+5/-2)
To merge this branch: bzr merge lp:~camptocamp/ocb-addons/7.0-fix-1335887
Reviewer Review Type Date Requested Status
Holger Brunn (Therp) Disapprove
Pedro Manuel Baeza code review Approve
Yann Papouin Approve
Ronald Portier (Therp) Approve
Review via email: mp+225028@code.launchpad.net

Commit message

Fix purchase order do_merge w/ 1st origin empty introduced on OCB on rev 10009

Description of the change

Fix a bug only introduced on OCB

To post a comment you must log in.
Revision history for this message
Ronald Portier (Therp) (rportier1962) wrote :

Personally I think this merge proposal is tackling the problem from the wrong end.

If we do not have an origin for a purchase order, the value for origin should be NULL, not an empty string.

The original code that introduced the bug should be amended to account for the possibility of NULL values in the database.

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

Ok I though empty string were store as Null as zero value for integer. Just check and it seems I'm wrong. I'll add a check instead of forcing to empty string.

Thanks for the review

10223. By Yannick Vaucher @ Camptocamp

Fix purchase order do_merge w/ 1st origin empty introduced on OCB on rev

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

@Ronald, I changed the fix according to your review

Revision history for this message
Ronald Portier (Therp) (rportier1962) wrote :

LGTM

Thanx!

review: Approve
Revision history for this message
Yann Papouin (yann-papouin) wrote :

Indeed, it seems the right way to do.
Thank you.

review: Approve
Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

Little comment inline.

Regards.

review: Needs Fixing (code review)
10224. By Yannick Vaucher @ Camptocamp

Imp concat

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

Thanks Pedro

Change made

Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

LGTM

Regards.

review: Approve (code review)
Revision history for this message
Holger Brunn (Therp) (hbrunn) wrote :

Development for 7.0 has moved to github on https://github.com/OCA/ocb - please move your merge proposal there if it is still valid.

(I close and reject this in order to have a cleaner overview for 6.1 MPs which indeed have to be done on launchpad)

review: Disapprove

Unmerged revisions

10224. By Yannick Vaucher @ Camptocamp

Imp concat

10223. By Yannick Vaucher @ Camptocamp

Fix purchase order do_merge w/ 1st origin empty introduced on OCB on rev

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'purchase/purchase.py'
2--- purchase/purchase.py 2014-04-15 08:12:11 +0000
3+++ purchase/purchase.py 2014-07-01 13:05:29 +0000
4@@ -793,8 +793,11 @@
5 if porder.notes:
6 order_infos['notes'] = (order_infos['notes'] or '') + ('\n%s' % (porder.notes,))
7 if porder.origin:
8- if not porder.origin in order_infos['origin'] and not order_infos['origin'] in porder.origin:
9- order_infos['origin'] = (order_infos['origin'] or '') + ' ' + porder.origin
10+ if not order_infos['origin']:
11+ order_infos['origin'] = porder.origin
12+ elif (not porder.origin in order_infos['origin']
13+ and not order_infos['origin'] in porder.origin):
14+ order_infos['origin'] += ' ' + porder.origin
15
16 for order_line in porder.order_line:
17 line_key = make_key(order_line, ('name', 'date_planned', 'taxes_id', 'price_unit', 'product_id', 'move_dest_id', 'account_analytic_id'))