Merge lp:~yann-papouin/openobject-addons/7.0-bug-1091268-purchase-merge-no-origin-duplicates into lp:openobject-addons/7.0

Proposed by Yann Papouin
Status: Needs review
Proposed branch: lp:~yann-papouin/openobject-addons/7.0-bug-1091268-purchase-merge-no-origin-duplicates
Merge into: lp:openobject-addons/7.0
Diff against target: 13 lines (+2/-1)
1 file modified
purchase/purchase.py (+2/-1)
To merge this branch: bzr merge lp:~yann-papouin/openobject-addons/7.0-bug-1091268-purchase-merge-no-origin-duplicates
Reviewer Review Type Date Requested Status
Yannick Vaucher @ Camptocamp (community) Needs Fixing
OpenERP Core Team Pending
Review via email: mp+210151@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

order_infos['origin'] can be False if origin of first Purchase order is empty

Thus it will fail when checking

not porder.origin in order_infos['origin']

review: Needs Fixing

Unmerged revisions

9885. By Yann Papouin

Do not duplicate origin when merging purchase orders

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-01-29 16:32:38 +0000
3+++ purchase/purchase.py 2014-03-10 08:59:32 +0000
4@@ -797,7 +797,8 @@
5 if porder.notes:
6 order_infos['notes'] = (order_infos['notes'] or '') + ('\n%s' % (porder.notes,))
7 if porder.origin:
8- order_infos['origin'] = (order_infos['origin'] or '') + ' ' + porder.origin
9+ if not porder.origin in order_infos['origin'] and not order_infos['origin'] in porder.origin:
10+ order_infos['origin'] = (order_infos['origin'] or '') + ' ' + porder.origin
11
12 for order_line in porder.order_line:
13 line_key = make_key(order_line, ('name', 'date_planned', 'taxes_id', 'price_unit', 'product_id', 'move_dest_id', 'account_analytic_id'))