← Back to team overview

openerp-community-reviewer team mailing list archive

[Merge] lp:~camptocamp/product-kitting/7.0-bom_stock-no-lines-1298860-gbr into lp:product-kitting

 

Guewen Baconnier @ Camptocamp has proposed merging lp:~camptocamp/product-kitting/7.0-bom_stock-no-lines-1298860-gbr into lp:product-kitting.

Commit message:
Error when computing bom_stock on a bill of material without lines.

When a bill of material has no lines, it can't produce more products, so the code can be moved in the 'if bom.bom_lines:' branch

Requested reviews:
  Product Core Editors (product-core-editors)
Related bugs:
  Bug #1298860 in Product - Kitting Management: "bom_stock: min() arg is an empty sequence"
  https://bugs.launchpad.net/product-kitting/+bug/1298860

For more details, see:
https://code.launchpad.net/~camptocamp/product-kitting/7.0-bom_stock-no-lines-1298860-gbr/+merge/213216

Fix lp:1298860


-- 
https://code.launchpad.net/~camptocamp/product-kitting/7.0-bom_stock-no-lines-1298860-gbr/+merge/213216
Your team Product Core Editors is requested to review the proposed merge of lp:~camptocamp/product-kitting/7.0-bom_stock-no-lines-1298860-gbr into lp:product-kitting.
=== modified file 'bom_stock/bom_stock.py'
--- bom_stock/bom_stock.py	2014-02-12 15:38:27 +0000
+++ bom_stock/bom_stock.py	2014-03-28 09:11:39 +0000
@@ -90,12 +90,13 @@
                     prod_min_quantities.append(prod_min_quantity)
                     if stop_compute_bom:
                         break
-            produced_qty = uom_obj._compute_qty_obj(cr, uid,
-                                                    bom.product_uom,
-                                                    bom.product_qty,
-                                                    bom.product_id.uom_id,
-                                                    context=context)
-            product_qty += min(prod_min_quantities) * produced_qty
+
+                produced_qty = uom_obj._compute_qty_obj(cr, uid,
+                                                        bom.product_uom,
+                                                        bom.product_qty,
+                                                        bom.product_id.uom_id,
+                                                        context=context)
+                product_qty += min(prod_min_quantities) * produced_qty
         return product_qty
 
     def _product_available(self, cr, uid, ids, field_names=None,


Follow ups