Impacted versions:10.0

Steps to reproduce: Create a BOM type kit and add a route, then create another that includes the the last type and also add a route. 

Current behavior: Create a MO for this last one and run the steps,it will produce 2 finished products consuming only half the raw materials
Expected behavior: Create a MO for this last one and run the steps,it should produce 1 finished product.

Video/Screenshot link (optional):
https://youtu.be/FiBr4g4V14U

addons/mrp/models/mrp_production.py
workorders += workorder
            
            moves_raw = self.move_raw_ids.filtered(lambda move: move.operation_id == operation)
            if len(workorders) == len(bom.routing_id.operation_ids):
                moves_raw |= self.move_raw_ids.filtered(lambda move: not move.operation_id)
            moves_finished = self.move_finished_ids.filtered(lambda move: move.operation_id == operation) 
            moves_raw.mapped('move_lot_ids').write({'workorder_id': workorder.id})
            (moves_finished + moves_raw).write({'workorder_id': workorder.id})
            workorder._generate_lot_ids()
        return workorders
    @api.multi
    def action_cancel(self):
        """ Cancels production order, unfinished stock moves and set procurement
        orders in exception """
        if any(workorder.state == 'progress' for workorder in self.mapped('workorder_ids')):
            raise UserError(_('You can not cancel production order, a work order is still in progress.'))
        ProcurementOrder = self.env['procurement.order']
        for production in self:
            production.workorder_ids.filtered(lambda x: x.state != 'cancel').action_cancel()
            finish_moves = production.move_finished_ids.filtered(lambda x: x.state not in ('done', 'cancel'))
            raw_moves = production.move_raw_ids.filtered(lambda x: x.state not in ('done', 'cancel'))
            (finish_moves | raw_moves).action_cancel()
            procurements = ProcurementOrder.search([('move_dest_id', 'in', (finish_moves | raw_moves).ids)])
            if procurements:
                procurements.cancel()
        
        ProcurementOrder.search([('production_id', 'in', self.ids)]).write({'state': 'exception'})
        self.write({'state': 'cancel'})
        return True
    def _cal_price(self, consumed_moves):