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

Proposed by Romain Deheele - Camptocamp
Status: Work in progress
Proposed branch: lp:~camptocamp/ocb-addons/7.0-fix-lp-1204832-RDE
Merge into: lp:ocb-addons
Diff against target: 34 lines (+13/-7)
1 file modified
stock/stock.py (+13/-7)
To merge this branch: bzr merge lp:~camptocamp/ocb-addons/7.0-fix-lp-1204832-RDE
Reviewer Review Type Date Requested Status
Stefan Rijnhart (Opener) Needs Fixing
Christophe CHAUVET code review, not test Pending
Cristian Salamea Pending
Review via email: mp+185545@code.launchpad.net

This proposal supersedes a proposal from 2013-08-21.

Description of the change

Hello,

This branch fixes bug #1204832: avoids gap on stock.picking.out sequence when chained picking setup

https://code.launchpad.net/~openerp-dev/openobject-addons/7.0-opw-595832-pna/+merge/178709

Romain

To post a comment you must log in.
Revision history for this message
Cristian Salamea (ovnicraft) wrote : Posted in a previous version of this proposal

I see the fix (in official addons ) is still fix commited.

LGTM, diff is the same from OPW.

Regards,

review: Approve
Revision history for this message
Christophe CHAUVET (christophe-chauvet) wrote : Posted in a previous version of this proposal

Hi

The code seem correct

Regards,

review: Approve (code review, not test)
Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote : Posted in a previous version of this proposal

I think the diff is missing this revision which was added later on: http://bazaar.launchpad.net/~openerp-dev/openobject-addons/7.0-opw-595832-pna/revision/9350. Although this is a trivial change, this will give a conflict if the OPW gets merged in a later point in time.

Note that we would not get a conflict if the OPW was cherrypicked into this branch using bzr. Please consider always using cherrypicking when you port from other branches.

BTW. the merger should attribute the original committer of the OPW.

So please adopt the change in line 12 from the OPW.

review: Needs Fixing
Revision history for this message
Romain Deheele - Camptocamp (romaindeheele) wrote :

I made needed changes.
Thanks for your advices,

Romain

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

Hi Romain,

thank you for taking my advice on cherrypicking! The fact that the diff is now different from that of the OPW shows that the world is not as simple as I would have liked. I think you found out (like me one moment ago) that the OPW-version now has conflicts. You seemed to have solved the conflict very well. But we have this rule in OCB that all code proposed to OCB should also be proposed verbatim to the official series. Again, this is also the best way to prevent conflicts in the synchronization process.

So could you please offer your resolution of the conflict back to lp:openobject-addons/7.0? The friendliest form I imagine is to submit a proposal onto the OPW branch itself (so not directly onto the series branch). I'll set my review to 'needs fixing' to indicate that the process still needs work, even if the code LGTM. Sorry for the hassle ;-)

review: Needs Fixing
Revision history for this message
Serpent Consulting Services (serpent-consulting-services) wrote : Posted in a previous version of this proposal

if old_ptype == 'internal' :
17 + model_name = 'stock.picking'
18 + else :
19 + model_name = 'stock.picking.' + old_ptype

Should be optimized:

model_name = 'stock.picking' + ( old_ptype != 'internal' and ('.' + old_ptype) or '')

AND
if pick_name will always be True, so should not be needed.
Instead this should be inline:

new_pick_name = picking.type == 'out' and seq_obj.get(cr, uid, 'stock.picking.' + ptype) or pick_name

Hope this helps.

(else and : should be together..pep8)

Thanks.

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

Hi Serpent,

remember that this is a backport of an OPW which is proposed against the official branches. If we start fixing nits in these branches, we will run into conflicts once the OPW gets merged.

Revision history for this message
Serpent Consulting Services (serpent-consulting-services) wrote :

Stefan,

Agreed, but we can ask opw team to correct to the right standard.

I believe, the corrections should land into stable as well.

They will agree too.

Thanks.

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

In that case, I hope that you can understand that as the person who actually resolves the occasional conflict that occurs when the official branches are replayed on OCB, I think this branch should not be merged with OCB until the OPW has merged our nits. Which will lead to considerable delays, defeating the purpose of having an OCB branch in the first place.

Revision history for this message
Serpent Consulting Services (serpent-consulting-services) wrote :

Yes Stefan, this branch should not be merged until OPW team merges right code. We cannot compromise with quality.

RDE C2C should request OPW team to treat this urgently as this bug sits on stable.

Thank you.

Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

Romain, what is the state of this MP?

Given the discussions, I put this MP as 'work in progress'. Please set it back to 'Needs review' once ready.

Revision history for this message
Romain Deheele - Camptocamp (romaindeheele) wrote :

The bug fix proposed here
https://code.launchpad.net/~openerp-dev/openobject-addons/7.0-opw-595832-pna/+merge/178709
generates a conflict when you try to merge it in official addons.
As the case is getting old, I proposed (https://code.launchpad.net/~openerp-dev/openobject-addons/7.0-opw-595832-pna/+merge/178709) to recreate a new branch based on updated addons.

Unmerged revisions

9497. By Pinakin Nayi (OpenERP)

[MRG][FIX] stock: improve sequence gap on delivery order & [IMP] nit code as there is no need to browse record

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'stock/stock.py'
2--- stock/stock.py 2013-09-10 07:21:00 +0000
3+++ stock/stock.py 2013-09-13 16:34:27 +0000
4@@ -2062,17 +2062,23 @@
5 for picking, todo in self._chain_compute(cr, uid, moves, context=context).items():
6 ptype = todo[0][1][5] and todo[0][1][5] or location_obj.picking_type_get(cr, uid, todo[0][0].location_dest_id, todo[0][1][0])
7 if picking:
8+ # Need to check name of old picking because it always considers picking as "OUT" when created from Sales Order
9+ pick_name = picking.name
10+ old_ptype = location_obj.picking_type_get(cr, uid, picking.move_lines[0].location_id, picking.move_lines[0].location_dest_id)
11+ if old_ptype != picking.type:
12+ if old_ptype == 'internal' :
13+ model_name = 'stock.picking'
14+ else :
15+ model_name = 'stock.picking.' + old_ptype
16+ old_pick_name = seq_obj.get(cr, uid, model_name)
17+ self.pool.get('stock.picking').write(cr, uid, [picking.id], {'name': old_pick_name, 'type': old_ptype}, context=context)
18+
19 # name of new picking according to its type
20- if ptype == 'internal':
21- new_pick_name = seq_obj.get(cr, uid,'stock.picking')
22+ if pick_name and picking.type == 'out':
23+ new_pick_name = pick_name
24 else :
25 new_pick_name = seq_obj.get(cr, uid, 'stock.picking.' + ptype)
26 pickid = self._create_chained_picking(cr, uid, new_pick_name, picking, ptype, todo, context=context)
27- # Need to check name of old picking because it always considers picking as "OUT" when created from Sales Order
28- old_ptype = location_obj.picking_type_get(cr, uid, picking.move_lines[0].location_id, picking.move_lines[0].location_dest_id)
29- if old_ptype != picking.type:
30- old_pick_name = seq_obj.get(cr, uid, 'stock.picking.' + old_ptype)
31- self.pool.get('stock.picking').write(cr, uid, [picking.id], {'name': old_pick_name, 'type': old_ptype}, context=context)
32 else:
33 pickid = False
34 for move, (loc, dummy, delay, dummy, company_id, ptype, invoice_state) in todo: