Merge lp:~numerigraphe-team/ocb-addons/7.0-stock-move-cancel-context into lp:ocb-addons

Proposed by Lionel Sausin - Initiatives/Numérigraphe
Status: Merged
Merge reported by: Lionel Sausin - Initiatives/Numérigraphe
Merged at revision: not available
Proposed branch: lp:~numerigraphe-team/ocb-addons/7.0-stock-move-cancel-context
Merge into: lp:ocb-addons
Diff against target: 22 lines (+3/-3)
1 file modified
stock/stock.py (+3/-3)
To merge this branch: bzr merge lp:~numerigraphe-team/ocb-addons/7.0-stock-move-cancel-context
Reviewer Review Type Date Requested Status
Sandy Carter (http://www.savoirfairelinux.com) Approve
Pedro Manuel Baeza code review Approve
Review via email: mp+210761@code.launchpad.net

Description of the change

This branch adds the missing context in several function calls in stock.inventory.action_cancel().
This is not necessary for the standard addons, but makes it possible to use the context in custom modules.

To post a comment you must log in.
Revision history for this message
Lionel Sausin - Initiatives/Numérigraphe (ls-initiatives) wrote :

This contains unwanted changes, I'll resubmit a cleaner branch.
Sorry about that.

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

Thanks for the catch!

review: Approve (code review)
Revision history for this message
Sandy Carter (http://www.savoirfairelinux.com) (sandy-carter) wrote :

Looks great!
I'm just wondering where the MP into lp:openobject-addons/7.0 is.

review: Needs Information
Revision history for this message
Lionel Sausin - Initiatives/Numérigraphe (ls-initiatives) wrote :

There isn't one because I don't expect the core team to accept this into a stable release. The proposal for trunk was left unmerged for ages.
But you're right, I'll try again - maybe it's my lucky day?
v6: https://code.launchpad.net/~numerigraphe-team/openobject-addons/6.0-stock-move-cancel-context/+merge/210801
v7: https://code.launchpad.net/~numerigraphe-team/openobject-addons/7.0-stock-move-cancel-context/+merge/210803

Revision history for this message
Sandy Carter (http://www.savoirfairelinux.com) (sandy-carter) wrote :

Thank you

review: Approve
Revision history for this message
Lionel Sausin - Initiatives/Numérigraphe (ls-initiatives) wrote :

It just got merged into the official v7.
Karma is such a weird thing...

Revision history for this message
Sandy Carter (http://www.savoirfairelinux.com) (sandy-carter) wrote :

Weird indeed.
That's why I do my MPs to v7, trunk and ocb. There's always a chance.

Le 2014-03-14 12:13, Lionel Sausin - Numérigraphe a écrit :
> It just got merged into the official v7.
> Karma is such a weird thing...
>

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 2014-03-04 13:08:40 +0000
3+++ stock/stock.py 2014-03-13 09:53:01 +0000
4@@ -2272,15 +2272,15 @@
5 if move.picking_id:
6 pickings.add(move.picking_id.id)
7 if move.move_dest_id and move.move_dest_id.state == 'waiting':
8- self.write(cr, uid, [move.move_dest_id.id], {'state': 'confirmed'})
9+ self.write(cr, uid, [move.move_dest_id.id], {'state': 'confirmed'}, context=context)
10 if context.get('call_unlink',False) and move.move_dest_id.picking_id:
11 wf_service = netsvc.LocalService("workflow")
12 wf_service.trg_write(uid, 'stock.picking', move.move_dest_id.picking_id.id, cr)
13- self.write(cr, uid, ids, {'state': 'cancel', 'move_dest_id': False})
14+ self.write(cr, uid, ids, {'state': 'cancel', 'move_dest_id': False}, context=context)
15 if not context.get('call_unlink',False):
16 for pick in self.pool.get('stock.picking').browse(cr, uid, list(pickings), context=context):
17 if all(move.state == 'cancel' for move in pick.move_lines):
18- self.pool.get('stock.picking').write(cr, uid, [pick.id], {'state': 'cancel'})
19+ self.pool.get('stock.picking').write(cr, uid, [pick.id], {'state': 'cancel'}, context=context)
20
21 wf_service = netsvc.LocalService("workflow")
22 for id in ids: