Merge lp:~camptocamp/stock-logistic-flows/6.1_fix_context_arg_default_val into lp:stock-logistic-flows/6.1

Proposed by Alexandre Fayolle - camptocamp
Status: Merged
Approved by: Alexandre Fayolle - camptocamp
Approved revision: 25
Merged at revision: 25
Proposed branch: lp:~camptocamp/stock-logistic-flows/6.1_fix_context_arg_default_val
Merge into: lp:stock-logistic-flows/6.1
Diff against target: 30 lines (+4/-2)
2 files modified
product_serial/stock.py (+1/-1)
stock_move_on_hold/product.py (+3/-1)
To merge this branch: bzr merge lp:~camptocamp/stock-logistic-flows/6.1_fix_context_arg_default_val
Reviewer Review Type Date Requested Status
Omar (Pexego) Approve
Stefan Rijnhart (Opener) Approve
Review via email: mp+163777@code.launchpad.net

Description of the change

[FIX] use of {} as default context value in function definition

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

LGTM

review: Approve
Revision history for this message
Omar (Pexego) (omar7r) wrote :

LGTM

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

Merged with 6.1 and 7.0 branches

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'product_serial/stock.py'
2--- product_serial/stock.py 2012-04-25 17:30:44 +0000
3+++ product_serial/stock.py 2013-05-14 17:04:28 +0000
4@@ -265,7 +265,7 @@
5 class stock_production_lot(osv.osv):
6 _inherit = "stock.production.lot"
7
8- def _last_location_id(self, cr, uid, ids, field_name, arg, context={}):
9+ def _last_location_id(self, cr, uid, ids, field_name, arg, context=None):
10 """Retrieves the last location where the product with given serial is.
11 Instead of using dates we assume the product is in the location having the
12 highest number of products with the given serial (should be 1 if no mistake). This
13
14=== modified file 'stock_move_on_hold/product.py'
15--- stock_move_on_hold/product.py 2012-03-07 12:56:37 +0000
16+++ stock_move_on_hold/product.py 2013-05-14 17:04:28 +0000
17@@ -27,10 +27,12 @@
18
19 _inherit = "product.product"
20
21- def _product_available(self, cr, uid, ids, field_names=None, arg=False, context={}):
22+ def _product_available(self, cr, uid, ids, field_names=None, arg=False, context=None):
23 if not field_names:
24 field_names = []
25 res = {}
26+ if context is None:
27+ context = {}
28 for id in ids:
29 res[id] = {}.fromkeys(field_names, 0.0)
30 for f in field_names:

Subscribers

People subscribed via source and target branches