Comment 1 for bug 689868

Revision history for this message
Francis Pierrat (fpierrat) wrote :

Naive remarks after analysing some files (I don't speak python fluently, and never developed anything around OpenErp, so don't be too hard if it's stupid!).

The data for the report seems to be assembled in addons\mrp\report\price.py
There I can read:

        for prod_id in ids:
            bom_ids = pooler.get_pool(cr.dbname).get('mrp.bom').search(cr, uid, [('product_id','=',prod_id)])
            prod = pooler.get_pool(cr.dbname).get('product.product').browse(cr, uid, prod_id)

            for bom_id in bom_ids:
                bom = pooler.get_pool(cr.dbname).get('mrp.bom').browse(cr, uid, bom_id)

                sub_boms = pooler.get_pool(cr.dbname).get('mrp.bom')._bom_explode(cr, uid, bom, number, [])

From the last line above, it seems to me it just checks the sub-boms (bom components?) included in the first bom, but NOT the boms of the included products that would have their own boms independantly and not as sub_boms.
Would it be possible here to complete this "sub_boms" array, with the boms of the products included in the first bom?
Something like
    products_used=pooler.get.......(products in the bom)
    boms_of_used_products = pooler.get (boms of used products)
    all_boms_to_consider = sub_boms + boms_of_used_products
I really think the problem is here, even if I fairly doubt the solution can look like this... once again, don't be too hard with a nondevelopper newcomer looking forward to help solving his own problem... ;-)