Merge lp:~openerp-dev/openobject-addons/trunk-bug-915541-mma into lp:openobject-addons

Proposed by Mayur Maheshwari(OpenERP)
Status: Merged
Merged at revision: 6399
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-915541-mma
Merge into: lp:openobject-addons
Diff against target: 17 lines (+3/-2)
1 file modified
procurement/schedulers.py (+3/-2)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-915541-mma
Reviewer Review Type Date Requested Status
Raphael Collet (OpenERP) (community) Approve
Review via email: mp+88847@code.launchpad.net

Description of the change

Hello,

       procurement: added read method instead of browse method

Thanks.
MMA

To post a comment you must log in.
Revision history for this message
Raphael Collet (OpenERP) (rco-openerp) wrote :

Thanks,
Raphael

review: Approve
Revision history for this message
Raphael Collet (OpenERP) (rco-openerp) wrote :

I will add some comment to explain why we use 'read' instead of 'browse'.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'procurement/schedulers.py'
2--- procurement/schedulers.py 2011-12-23 15:23:43 +0000
3+++ procurement/schedulers.py 2012-01-17 12:46:25 +0000
4@@ -180,10 +180,11 @@
5
6 for warehouse in warehouse_obj.browse(cr, uid, warehouse_ids, context=context):
7 context['warehouse'] = warehouse
8- for product in product_obj.browse(cr, uid, products_id, context=context):
9- if product.virtual_available >= 0.0:
10+ for product_availability in product_obj.read(cr, uid, products_id, ['virtual_available'], context=context):
11+ if product_availability['virtual_available'] >= 0.0:
12 continue
13
14+ product = product_obj.browse(cr, uid, [product_availability['id']], context=context)[0]
15 if product.supply_method == 'buy':
16 location_id = warehouse.lot_input_id.id
17 elif product.supply_method == 'produce':

Subscribers

People subscribed via source and target branches

to all changes: